Enabled adding new attributes to a DN
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
34
app/View/Components/AttributeType.php
Normal file
34
app/View/Components/AttributeType.php
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user