Display a DN entry with language tags - work for #16

This commit is contained in:
2025-03-23 22:16:26 +11:00
parent 705bfb2d64
commit 633513d3e9
12 changed files with 132 additions and 50 deletions

View File

@@ -12,17 +12,19 @@ class Attribute extends Component
public bool $edit;
public bool $new;
public bool $old;
public ?string $na;
public string $langtag;
public ?string $na; // Text to render if the LDAPAttribute is null
/**
* Create a new component instance.
*/
public function __construct(?LDAPAttribute $o,bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE,?string $na=NULL)
public function __construct(?LDAPAttribute $o,bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE,string $langtag='',?string $na=NULL)
{
$this->o = $o;
$this->edit = $edit;
$this->old = $old;
$this->new = $new;
$this->langtag = $langtag;
$this->na = $na;
}

View File

@@ -13,14 +13,16 @@ class AttributeType extends Component
{
private LDAPAttribute $o;
private bool $new;
private string $langtag;
/**
* Create a new component instance.
*/
public function __construct(LDAPAttribute $o,bool $new=FALSE)
public function __construct(LDAPAttribute $o,bool $new=FALSE,string $langtag='')
{
$this->o = $o;
$this->new = $new;
$this->langtag = $langtag;
}
/**
@@ -30,6 +32,7 @@ class AttributeType extends Component
{
return view('components.attribute-type')
->with('o',$this->o)
->with('new',$this->new);
->with('new',$this->new)
->with('langtag',$this->langtag);
}
}