Rework Components to use consistent variables and interface

This commit is contained in:
2024-01-20 10:36:30 +11:00
parent cb06f3dcb6
commit 6991983743
12 changed files with 46 additions and 25 deletions

View File

@@ -21,12 +21,13 @@ final class JpegPhoto extends Binary
$this->internal = FALSE;
}
public function render(bool $edit=FALSE,bool $blank=FALSE): View
public function render(bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE): View
{
return view('components.attribute.binary.jpegphoto')
->with('edit',$edit)
->with('blank',$blank)
->with('o',$this)
->with('edit',$edit)
->with('old',$old)
->with('new',$new)
->with('f',new \finfo);
}
}

View File

@@ -13,7 +13,7 @@ abstract class Internal extends Attribute
{
protected bool $is_internal = TRUE;
public function render(bool $edit=FALSE,bool $blank=FALSE): View
public function render(bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE): View
{
// @note Internal attributes cannot be edited
return view('components.attribute.internal')

View File

@@ -11,7 +11,7 @@ use App\Classes\LDAP\Attribute\Internal;
*/
final class Timestamp extends Internal
{
public function render(bool $edit=FALSE,bool $blank=FALSE): View
public function render(bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE): View
{
// @note Internal attributes cannot be edited
return view('components.attribute.internal.timestamp')

View File

@@ -39,10 +39,12 @@ final class ObjectClass extends Attribute
return $this->structural->search($value) !== FALSE;
}
public function render(bool $edit=FALSE,bool $blank=FALSE): View
public function render(bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE): View
{
return view('components.attribute.objectclass')
->with('o',$this)
->with('edit',$edit)
->with('o',$this);
->with('old',$old)
->with('new',$new);
}
}

View File

@@ -14,11 +14,12 @@ final class Password extends Attribute
{
use MD5Updates;
public function render(bool $edit=FALSE,bool $blank=FALSE): View
public function render(bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE): View
{
return view('components.attribute.password')
->with('o',$this)
->with('edit',$edit)
->with('blank',$blank)
->with('o',$this);
->with('old',$old)
->with('new',$new);
}
}

View File

@@ -49,7 +49,7 @@ abstract class Schema extends Attribute
return Arr::get(($array ? $array->get($string) : []),$key);
}
public function render(bool $edit=FALSE,bool $blank=FALSE): View
public function render(bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE): View
{
// @note Schema attributes cannot be edited
return view('components.attribute.internal')

View File

@@ -33,7 +33,7 @@ final class Mechanisms extends Schema
return parent::_get(config_path('ldap_supported_saslmechanisms.txt'),$string,$key);
}
public function render(bool $edit=FALSE,bool $blank=FALSE): View
public function render(bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE): View
{
// @note Schema attributes cannot be edited
return view('components.attribute.schema.mechanisms')

View File

@@ -34,7 +34,7 @@ final class OID extends Schema
return parent::_get(config_path('ldap_supported_oids.txt'),$string,$key);
}
public function render(bool $edit=FALSE,bool $blank=FALSE): View
public function render(bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE): View
{
// @note Schema attributes cannot be edited
return view('components.attribute.schema.oid')