mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
fix identity name entry
This commit is contained in:
parent
af16893ec4
commit
a4406499dd
3 changed files with 21 additions and 12 deletions
|
|
@ -92,6 +92,10 @@ class Auth
|
||||||
Auth\Option\Identity::ID_CRT_NEW
|
Auth\Option\Identity::ID_CRT_NEW
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->_options[
|
||||||
|
Auth\Option\Identity::ID_CRT_NEW
|
||||||
|
]->useName();
|
||||||
|
|
||||||
// Search database for auth records
|
// Search database for auth records
|
||||||
foreach ($this->page->container->browser->database->auth->like(
|
foreach ($this->page->container->browser->database->auth->like(
|
||||||
sprintf(
|
sprintf(
|
||||||
|
|
@ -140,7 +144,7 @@ class Auth
|
||||||
{
|
{
|
||||||
// Append name entry after new identity option
|
// Append name entry after new identity option
|
||||||
$content->add(
|
$content->add(
|
||||||
$option->name,
|
$option->name->gtk,
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
0
|
0
|
||||||
|
|
@ -203,7 +207,7 @@ class Auth
|
||||||
$this->page->container->browser->database->identity->add(
|
$this->page->container->browser->database->identity->add(
|
||||||
$identity->crt(),
|
$identity->crt(),
|
||||||
$identity->key(),
|
$identity->key(),
|
||||||
$this->_name->get_text() ? $this->_name->get_text() : null
|
$option->name->getValue()
|
||||||
),
|
),
|
||||||
$this->page->navbar->request->getValue()
|
$this->page->navbar->request->getValue()
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -98,12 +98,10 @@ class Identity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setName(
|
public function useName(
|
||||||
string $label
|
bool $value = true
|
||||||
): void
|
): void
|
||||||
{
|
{
|
||||||
$this->name = new Identity\Name(
|
$this->name = $value ? new Identity\Name($this) : null;
|
||||||
$this
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -6,6 +6,8 @@ namespace Yggverse\Yoda\Entity\Browser\Container\Page\Auth\Option\Identity;
|
||||||
|
|
||||||
use \GtkEntry;
|
use \GtkEntry;
|
||||||
|
|
||||||
|
use Yggverse\Yoda\Entity\Browser\Container\Page\Auth\Option\Identity;
|
||||||
|
|
||||||
class Name
|
class Name
|
||||||
{
|
{
|
||||||
// GTK
|
// GTK
|
||||||
|
|
@ -28,26 +30,31 @@ class Name
|
||||||
// Init GTK
|
// Init GTK
|
||||||
$this->gtk = new GtkEntry;
|
$this->gtk = new GtkEntry;
|
||||||
|
|
||||||
$this->_name->set_alignment(
|
$this->gtk->set_alignment(
|
||||||
$this::ALIGNMENT
|
$this::ALIGNMENT
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->_name->set_placeholder_text(
|
$this->gtk->set_placeholder_text(
|
||||||
_($this::PLACEHOLDER)
|
_($this::PLACEHOLDER)
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->_name->set_margin_start(
|
$this->gtk->set_margin_start(
|
||||||
$this::MARGIN
|
$this::MARGIN
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->_name->set_margin_end(
|
$this->gtk->set_margin_end(
|
||||||
$this::MARGIN
|
$this::MARGIN
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->_name->set_margin_bottom(
|
$this->gtk->set_margin_bottom(
|
||||||
$this::MARGIN
|
$this::MARGIN
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->gtk->show();
|
$this->gtk->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getValue(): ?string
|
||||||
|
{
|
||||||
|
return $this->gtk->get_text();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue