2023-03-31 15:55:08 +11:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\View\Components;
|
|
|
|
|
|
|
|
use Illuminate\View\Component;
|
|
|
|
|
|
|
|
use App\Classes\LDAP\Attribute as LDAPAttribute;
|
|
|
|
|
|
|
|
class Attribute extends Component
|
|
|
|
{
|
2025-01-15 23:29:53 +11:00
|
|
|
public ?LDAPAttribute $o;
|
2023-03-31 15:55:08 +11:00
|
|
|
public bool $edit;
|
2023-09-02 20:50:54 +10:00
|
|
|
public bool $new;
|
2024-01-20 10:36:30 +11:00
|
|
|
public bool $old;
|
2025-01-15 23:29:53 +11:00
|
|
|
public ?string $na;
|
2023-03-31 15:55:08 +11:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new component instance.
|
|
|
|
*/
|
2025-01-15 23:29:53 +11:00
|
|
|
public function __construct(?LDAPAttribute $o,bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE,string $na=NULL)
|
2023-03-31 15:55:08 +11:00
|
|
|
{
|
|
|
|
$this->o = $o;
|
2024-01-20 10:36:30 +11:00
|
|
|
$this->edit = $edit;
|
|
|
|
$this->old = $old;
|
2023-09-02 20:50:54 +10:00
|
|
|
$this->new = $new;
|
2025-01-15 23:29:53 +11:00
|
|
|
$this->na = $na;
|
2023-03-31 15:55:08 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the view / contents that represent the component.
|
|
|
|
*
|
|
|
|
* @return \Illuminate\Contracts\View\View|\Closure|string
|
|
|
|
*/
|
|
|
|
public function render()
|
|
|
|
{
|
2025-01-15 23:29:53 +11:00
|
|
|
return $this->o
|
|
|
|
? $this->o
|
|
|
|
->render($this->edit,$this->old,$this->new)
|
|
|
|
: $this->na;
|
2023-03-31 15:55:08 +11:00
|
|
|
}
|
|
|
|
}
|