public function prepareView(\Nethgui\View\ViewInterface $view) { parent::prepareView($view); if ($this->getAction('SaveState')->hasResumeCallback()) { $this->getAction('SaveState')->resumeView($view[$this->myCurrentAction]); } }
public function initialize() { $columns = array('Key', 'Host', 'Description', 'Actions'); $parameterSchema = array(array('name', Validate::USERNAME, \Nethgui\Controller\Table\Modify::KEY), array('Description', Validate::ANYTHING, \Nethgui\Controller\Table\Modify::FIELD)); $this->setTableAdapter($this->getPlatform()->getTableAdapter('fwrules', 'bypass-src'))->setColumns($columns)->addRowAction(new \NethServer\Module\Proxy\BypassSrc\Modify('update'))->addRowAction(new \NethServer\Module\Proxy\BypassSrc\Modify('delete'))->addTableAction(new \NethServer\Module\Proxy\BypassSrc\Modify('create'))->addTableAction(new \Nethgui\Controller\Table\Help('Help')); parent::initialize(); }
public function prepareView(\Nethgui\View\ViewInterface $view) { parent::prepareView($view); if (is_object($view['read'])) { $view['read']->setTemplate('NethServer\\Template\\Pki\\Index'); } }
public function initialize() { $columns = array('Key', 'Addpkg', 'Delpkg', 'Description', 'Actions'); $parameterSchema = array(array('role', Validate::ANYTHING, \Nethgui\Controller\Table\Modify::KEY), array('Addpkg', Validate::ANYTHING, \Nethgui\Controller\Table\Modify::FIELD), array('Delpkg', Validate::ANYTHING, \Nethgui\Controller\Table\Modify::FIELD), array('Description', Validate::ANYTHING, \Nethgui\Controller\Table\Modify::FIELD)); $this->setTableAdapter($this->getPlatform()->getTableAdapter('roles', 'role'))->setColumns($columns)->addTableAction(new \Nethgui\Controller\Table\Modify('create', $parameterSchema, 'NethServer\\Template\\NetworkPackageManager\\CreateUpdate'))->addTableAction(new \Nethgui\Controller\Table\Help('Help'))->addRowAction(new \Nethgui\Controller\Table\Modify('update', $parameterSchema, 'NethServer\\Template\\NetworkPackageManager\\CreateUpdate'))->addRowAction(new \Nethgui\Controller\Table\Modify('delete', $parameterSchema, 'Nethgui\\Template\\Table\\Delete')); parent::initialize(); }
public function initialize() { $columns = array('Key', 'Description', 'Actions'); $parameterSchema = array(array('name', Validate::USERNAME, \Nethgui\Controller\Table\Modify::KEY), array('Description', Validate::ANYTHING, \Nethgui\Controller\Table\Modify::FIELD)); $this->setTableAdapter($this->getPlatform()->getTableAdapter('contentfilter', 'category'))->setColumns($columns)->addRowAction(new \NethServer\Module\ContentFilter\Categories\Modify('update'))->addRowAction(new \NethServer\Module\ContentFilter\Categories\Modify('delete'))->addTableAction(new \NethServer\Module\ContentFilter\Categories\Modify('create'))->addTableAction(new \Nethgui\Controller\Table\Help('Help')); parent::initialize(); }
public function initialize() { $columns = array('Key', 'FirstName', 'LastName', 'Actions'); $this->setTableAdapter($this->getPlatform()->getTableAdapter('accounts', 'user'))->setColumns($columns)->addTableActionPluggable(new User\Modify('create'))->addTableAction(new \Nethgui\Controller\Table\Help('Help'))->addRowActionPluggable(new User\Modify('update'))->addRowAction(new User\ChangePassword())->addRowAction(new User\ToggleLock('lock'))->addRowAction(new User\ToggleLock('unlock'))->addRowAction(new User\Modify('delete')); $this->expired = json_decode($this->getPlatform()->exec('/usr/bin/sudo /usr/libexec/nethserver/password-expiration')->getOutput()); parent::initialize(); }
public function initialize() { $columns = array('Key', 'interface', 'weight', 'Description', 'Actions'); $parameterSchema = array(array('name', Validate::USERNAME, \Nethgui\Controller\Table\Modify::KEY), array('checkip', Validate::ANYTHING, \Nethgui\Controller\Table\Modify::FIELD), array('interface', Validate::ANYTHING, \Nethgui\Controller\Table\Modify::FIELD), array('weight', Validate::ANYTHING, \Nethgui\Controller\Table\Modify::FIELD), array('status', Validate::SERVICESTATUS, \Nethgui\Controller\Table\Modify::FIELD), array('Description', Validate::ANYTHING, \Nethgui\Controller\Table\Modify::FIELD)); $this->setTableAdapter($this->getPlatform()->getTableAdapter('networks', 'provider'))->setColumns($columns)->addRowAction(new \NethServer\Module\Providers\Modify('update'))->addRowAction(new \Nethgui\Controller\Table\Modify('delete', $parameterSchema, 'Nethgui\\Template\\Table\\Delete'))->addTableAction(new \NethServer\Module\Providers\Modify('create'))->addTableAction(new \NethServer\Module\Providers\Configure())->addTableAction(new \Nethgui\Controller\Table\Help('Help')); parent::initialize(); }
public function initialize() { $columns = array('Key', 'Mask', 'Description', 'Actions'); $parameterSchema = array(array('network', Validate::IPv4, \Nethgui\Controller\Table\Modify::KEY), array('Mask', Validate::IPv4, \Nethgui\Controller\Table\Modify::FIELD), array('Description', Validate::ANYTHING, \Nethgui\Controller\Table\Modify::FIELD)); $this->setTableAdapter(new LocalNetwork\NetworkAdapter($this->getPlatform()))->setColumns($columns)->addTableAction(new \NethServer\Module\LocalNetwork\Modify('create', $parameterSchema, 'NethServer\\Template\\LocalNetwork\\CreateUpdate'))->addTableAction(new \Nethgui\Controller\Table\Help('Help'))->addRowAction(new \Nethgui\Controller\Table\Modify('delete', $parameterSchema, 'Nethgui\\Template\\Table\\Delete')); parent::initialize(); }
public function initialize() { $columns = array('Key', 'Description', 'Actions'); $parameterSchema = array(array('hostname', Validate::HOSTNAME_FQDN, \Nethgui\Controller\Table\Modify::KEY), array('Description', Validate::ANYTHING, \Nethgui\Controller\Table\Modify::FIELD)); $this->setTableAdapter($this->getPlatform()->getTableAdapter('hosts', 'self'))->setColumns($columns)->addRowAction(new \Nethgui\Controller\Table\Modify('delete', $parameterSchema, 'Nethgui\\Template\\Table\\Delete'))->addRowAction(new \Nethgui\Controller\Table\Modify('update', $parameterSchema, 'NethServer\\Template\\Hosts\\ServerAlias'))->addTableAction(new \Nethgui\Controller\Table\Modify('create', $parameterSchema, 'NethServer\\Template\\Hosts\\ServerAlias'))->addTableAction(new \Nethgui\Controller\Table\Help('Help')); parent::initialize(); }
public function initialize() { $columns = array('Key', 'status', 'running', 'ports', 'Actions'); $this->setTableAdapter($this->getPlatform()->getTableAdapter('configuration', 'service', function ($key, $record) { return file_exists("/etc/e-smith/db/configuration/defaults/{$key}/status"); }))->addRowAction(new Services\Systemctl('restart'))->addRowAction(new Services\Systemctl('stop'))->addRowAction(new Services\Systemctl('start'))->setColumns($columns); parent::initialize(); }
public function initialize() { $this->setTableAdapter(new \NethServer\Module\MailAccount\SharedMailbox\SharedMailboxAdapter($this->getPlatform())); $this->setColumns(array('Key', 'Actions')); $this->addTableAction(new \NethServer\Module\MailAccount\SharedMailbox\Edit('create')); $this->addTableAction(new \Nethgui\Controller\Table\Help('Help')); $this->addRowAction(new \NethServer\Module\MailAccount\SharedMailbox\Edit('update')); $this->addRowAction(new \NethServer\Module\MailAccount\SharedMailbox\Edit('delete')); parent::initialize(); }
public function initialize() { $adapter = new Group\GroupAdapter($this->getPlatform()); $this->setTableAdapter($adapter)->setColumns($adapter->getColumns())->addRowAction(new Group\Modify('update'))->addRowAction(new Group\Modify('delete')); if (in_array('Actions', $adapter->getColumns())) { $this->addTableAction(new Group\Modify('create')); $this->addTableAction(new \Nethgui\Controller\Table\Help('Help')); } parent::initialize(); }
public function initialize() { $adapter = new User\UserAdapter($this->getPlatform()); $this->setTableAdapter($adapter)->setColumns($adapter->getColumns())->addRowAction(new User\Modify('update'))->addRowAction(new User\ChangePassword())->addRowAction(new User\ToggleLock('lock'))->addRowAction(new User\ToggleLock('unlock'))->addRowAction(new User\Modify('delete')); if (in_array('Actions', $adapter->getColumns())) { $this->addTableAction(new User\Modify('create')); $this->addTableAction(new \Nethgui\Controller\Table\Help('Help')); } parent::initialize(); }
public function initialize() { $columns = array('Key', 'Description', 'IpAddress', 'MacAddress', 'Actions'); $tableAdapter = new Reservation\DhcpAdapter($this->getPlatform()); $parameterSchema = array(array('hostname', Validate::HOSTNAME_SIMPLE, \Nethgui\Controller\Table\Modify::KEY), array('Description', Validate::ANYTHING, \Nethgui\Controller\Table\Modify::FIELD), array('IpAddress', Validate::IPv4, \Nethgui\Controller\Table\Modify::FIELD), array('MacAddress', Validate::MACADDRESS, \Nethgui\Controller\Table\Modify::FIELD)); $this->setTableAdapter($tableAdapter)->setColumns($columns)->addRowAction(new Reservation\Reserve())->addRowAction(new Reservation\Modify('update'))->addRowAction(new Reservation\Modify('delete'))->addTableAction(new Reservation\Modify('create'))->addTableAction(new \Nethgui\Controller\Table\Help('Help')); $self = $this; array_map(function ($id) use($parameterSchema, $self) { $self->getAction($id)->setSchema($parameterSchema); }, array('create', 'delete', 'Reserve', 'update')); parent::initialize(); }
public function initialize() { $columns = array('Key', 'ports', 'access', 'Actions'); $this->setTableAdapter($this->getPlatform()->getTableAdapter('configuration', 'service', function ($key, $record) { if (!isset($record['TCPPorts']) && !isset($record['UDPPorts']) && !isset($record['TCPPort']) && !isset($record['UDPPort'])) { return false; } if (!isset($record['access']) || !isset($record['status'])) { return false; } return true; }))->addRowAction(new \NethServer\Module\NetworkServices\Modify('update'))->addTableAction(new \Nethgui\Controller\Table\Help('Help'))->setColumns($columns); parent::initialize(); }
public function initialize() { $columns = array('Key', array('name' => 'size', 'columnDefs' => array('type' => 'file-size')), array('name' => 'max_size', 'columnDefs' => array('type' => 'file-size')), array('name' => 'percentage', 'columnDefs' => array('type' => 'percent')), 'msg_number'); $this->setTableAdapter(new \Nethgui\Adapter\LazyLoaderAdapter(array($this, 'readQuota')))->setColumns($columns); parent::initialize(); }
public function initialize() { $columns = array('Id', 'Sender', 'Size', 'Timestamp', 'Recipients', 'Actions'); $this->setTableAdapter(new MailQueue\MailQueueAdapter($this->getPlatform()))->setColumns($columns)->addTableAction(new MailQueue\Refresh())->addTableAction(new MailQueue\Flush())->addTableAction(new MailQueue\DeleteAll())->addRowAction(new MailQueue\Delete()); parent::initialize(); }
public function initialize() { $columns = array('Key', 'Description', 'Actions'); $this->setTableAdapter($this->getPlatform()->getTableAdapter('accounts', 'ibay'))->setColumns($columns)->addTableActionPluggable(new SharedFolder\Modify('create'))->addTableAction(new \Nethgui\Controller\Table\Help('Help'))->addRowActionPluggable(new SharedFolder\Modify('update'))->addRowAction(new SharedFolder\ResetPermissions())->addRowAction(new SharedFolder\Modify('delete')); parent::initialize(); }
public function initialize() { $columns = array('Key', 'Description', 'Actions'); $this->setTableAdapter($this->getPlatform()->getTableAdapter('hosts', 'host-group'))->addRowAction(new \NethServer\Module\FirewallObjects\HostGroups\Modify('update'))->addRowAction(new \NethServer\Module\FirewallObjects\HostGroups\Modify('delete'))->addTableAction(new \NethServer\Module\FirewallObjects\HostGroups\Modify('create'))->addTableAction(new \Nethgui\Controller\Table\Help('Help'))->setColumns($columns); parent::initialize(); }
/** * XXX: experimental -> CSS injection **/ public function prepareView(\Nethgui\View\ViewInterface $view) { $cssCode = "\n tr.running td:nth-child(3) { color: green }\n tr.stopped td:nth-child(3) { color: red }\n "; $view->getCommandList('/Resource/css')->appendCode($cssCode, 'css'); $moduleUrl = json_encode($view->getModuleUrl("/Dashboard/Services")); $jsCode = "\n(function ( \$ ) {\n \$(document).ready(function() {\n \$.Nethgui.Server.ajaxMessage({\n isMutation: false,\n url: {$moduleUrl}\n });\n });\n} ( jQuery ));\n "; $view->getCommandList('/Resource/js')->appendCode($jsCode, 'js'); parent::prepareView($view); }
public function prepareView(\Nethgui\View\ViewInterface $view) { parent::prepareView($view); if ($this->getRequest()->hasParameter('renameSuccess')) { $view->getCommandList('read')->show(); } }
public function initialize() { $columns = array('Key', 'account', 'ssl', 'proto', 'nokeep', 'active', 'Actions'); $this->setTableAdapter($this->getPlatform()->getTableAdapter('fetchmail', 'fetchmail'))->setColumns($columns)->addTableAction(new \NethServer\Module\Fetchmail\Accounts\Modify('create'))->addTableAction(new \NethServer\Module\Fetchmail\Accounts\Download('Download'))->addTableAction(new \Nethgui\Controller\Table\Help('Help'))->addRowAction(new \NethServer\Module\Fetchmail\Accounts\ToggleEnable('disable'))->addRowAction(new \NethServer\Module\Fetchmail\Accounts\ToggleEnable('enable'))->addRowAction(new \NethServer\Module\Fetchmail\Accounts\Modify('update'))->addRowAction(new \NethServer\Module\Fetchmail\Accounts\Modify('delete')); parent::initialize(); }
public function initialize() { $columns = array('Key', 'Target', 'Protocol', 'Description', 'Actions'); $this->setTableAdapter($this->getPlatform()->getTableAdapter('proxypass', 'ProxyPass'))->setColumns($columns)->addTableAction(new \NethServer\Module\ProxyPass\Modify('create'))->addTableAction(new \Nethgui\Controller\Table\Help('Help'))->addRowAction(new \NethServer\Module\ProxyPass\Modify('update'))->addRowAction(new \NethServer\Module\ProxyPass\Modify('delete')); parent::initialize(); }
public function initialize() { $columns = array('Key', 'Description', 'Actions'); $this->setTableAdapter($this->getPlatform()->getTableAdapter('accounts', 'group'))->setColumns($columns)->addTableActionPluggable(new Group\Modify('create'), 'PlugService')->addTableAction(new \Nethgui\Controller\Table\Help('Help'))->addRowActionPluggable(new Group\Modify('update'), 'PlugService')->addRowActionPluggable(new Group\Modify('delete'), 'PlugDelete'); parent::initialize(); }
public function initialize() { $columns = array('Key', 'Expiration', 'VPNRemoteNetwork', 'VPNRemoteNetmask', 'Actions'); $this->setTableAdapter(new \Nethgui\Adapter\LazyLoaderAdapter(array($this, 'readCertIndexAccounts')))->setColumns($columns)->addTableAction(new \NethServer\Module\VPN\Accounts\Modify('create'))->addTableAction(new \Nethgui\Controller\Table\Help('Help'))->addRowAction(new \NethServer\Module\VPN\Accounts\Modify('update'))->addRowAction(new \NethServer\Module\VPN\Accounts\Modify('delete'))->addRowAction(new \NethServer\Module\VPN\Accounts\Download('download')); parent::initialize(); }
public function initialize() { $columns = array('Key', 'Description', 'Actions'); $this->setTableAdapter($this->getPlatform()->getTableAdapter('domains', 'domain'))->setColumns($columns)->addRowActionPluggable(new \NethServer\Module\Mail\Domain\Modify('update'), 'PlugTransport')->addRowAction(new \NethServer\Module\Mail\Domain\Modify('delete'))->addTableActionPluggable(new \NethServer\Module\Mail\Domain\Modify('create'), 'PlugTransport')->addTableAction(new \Nethgui\Controller\Table\Help('Help')); parent::initialize(); }
public function initialize() { $columns = array('Key', 'In', 'Out', 'Description', 'Actions'); $this->setTableAdapter($this->getPlatform()->getTableAdapter('tc', 'device'))->setColumns($columns)->addTableAction(new \NethServer\Module\TrafficShaping\Interfaces\Modify('create'))->addTableAction(new \Nethgui\Controller\Table\Help('Help'))->addRowAction(new \NethServer\Module\TrafficShaping\Interfaces\Modify('update'))->addRowAction(new \NethServer\Module\TrafficShaping\Interfaces\Modify('delete')); parent::initialize(); }
public function initialize() { $columns = array('Key', 'Account', 'Flag', 'Actions'); $this->setTableAdapter($this->getPlatform()->getTableAdapter('accounts', 'pseudonym'))->setColumns($columns)->addTableAction(new Pseudonym\Modify('create'))->addTableAction(new \Nethgui\Controller\Table\Help('Help'))->addRowAction(new Pseudonym\Modify('update'))->addRowAction(new Pseudonym\Modify('delete')); parent::initialize(); }
public function initialize() { $columns = array('Key', 'Router', 'Device', 'Metric', 'Description', 'Actions'); $this->setTableAdapter($this->getPlatform()->getTableAdapter('routes', 'static'))->setColumns($columns)->addTableAction(new \NethServer\Module\StaticRoutes\Modify('create'))->addTableAction(new \Nethgui\Controller\Table\Help('Help'))->addRowAction(new \NethServer\Module\StaticRoutes\Modify('update'))->addRowAction(new \NethServer\Module\StaticRoutes\Modify('delete')); parent::initialize(); }
public function initialize() { $columns = array('Key', 'Actions'); $this->setTableAdapter($this->getPlatform()->getTableAdapter('vpn', 'ipsec-tunnel'))->setColumns($columns)->addTableAction(new \NethServer\Module\VPN\IpsecTunnels\Modify('create'))->addTableAction(new \Nethgui\Controller\Table\Help('Help'))->addRowAction(new \NethServer\Module\VPN\IpsecTunnels\Modify('update'))->addRowAction(new \NethServer\Module\VPN\IpsecTunnels\Modify('delete')); parent::initialize(); }