LABEL_CREATE_ANOTHER_ACCOUNT = _('Create another group'); $this->LABEL_BACK_TO_ACCOUNT_LIST = _('Back to group list'); } /** * {@inheritDoc} */ public function getAlias(): string { return _("NIS netgroups"); } /** * {@inheritDoc} */ public function getDescription(): string { return _("NIS netgroup entries"); } /** * {@inheritDoc} */ public function getIcon(): string { return 'group.svg'; } /** * {@inheritDoc} */ public function getListClassName(): string { return lamNetgroupList::class; } /** * {@inheritDoc} */ public function getDefaultListAttributes(): string { return "#cn;#description;#memberNisNetgroup"; } /** * {@inheritDoc} */ public function getTitleBarTitle(accountContainer $container): ?string { // get attributes $attributes = null; if ($container->getAccountModule('nisnetgroup') != null) { $attributes = $container->getAccountModule('nisnetgroup')->getAttributes(); } // check if a common name is set if (isset($attributes['cn'][0])) { return htmlspecialchars($attributes['cn'][0]); } // new entry if ($container->isNewAccount) { return _("New group"); } // fall back to default return parent::getTitleBarTitle($container); } /** * {@inheritDoc} */ public function getTitleBarSubtitle(accountContainer $container): string { // get attributes $attributes = null; if ($container->getAccountModule('nisnetgroup') != null) { $attributes = $container->getAccountModule('nisnetgroup')->getAttributes(); } if ($attributes == null) { return ''; } $subtitle = ''; // check if a description can be shown if (isset($attributes['description'][0])) { $subtitle .= htmlspecialchars($attributes['description'][0]); } return $subtitle; } } /** * Generates the list view. * * @package lists * @author Roland Gruber * */ class lamNetgroupList extends lamList { /** * Constructor * * @param ConfiguredType $type account type */ public function __construct(ConfiguredType $type) { parent::__construct($type); $this->labels = [ 'nav' => _("Group count: %s"), 'error_noneFound' => _("No groups found!"), 'newEntry' => _("New group"), 'deleteEntry' => _("Delete selected groups") ]; } }