Enabled adding new attributes to a DN

This commit is contained in:
2023-09-02 20:50:54 +10:00
parent 6d900d0964
commit 652cdee034
22 changed files with 403 additions and 105 deletions

View File

@@ -10,16 +10,18 @@ class Attribute extends Component
{
public LDAPAttribute $o;
public bool $edit;
public bool $new;
/**
* Create a new component instance.
*
* @return void
*/
public function __construct(bool $edit,LDAPAttribute $o)
public function __construct(bool $edit,LDAPAttribute $o,bool $new=FALSE)
{
$this->edit = $edit;
$this->o = $o;
$this->new = $new;
}
/**
@@ -29,6 +31,6 @@ class Attribute extends Component
*/
public function render()
{
return $this->o->render($this->edit);
return $this->o->render($this->edit,$this->new);
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
use App\Classes\LDAP\Attribute as LDAPAttribute;
class AttributeType extends Component
{
public LDAPAttribute $o;
public bool $new;
/**
* Create a new component instance.
*/
public function __construct(LDAPAttribute $o,bool $new=FALSE)
{
$this->o = $o;
$this->new = $new;
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.attribute-type')
->with('o',$this->o)
->with('new',$this->new);
}
}