Пример #1
0
 public function prepareView(\Nethgui\View\ViewInterface $view)
 {
     parent::prepareView($view);
     $templates = array('create' => 'NethServer\\Template\\TrafficShaping\\Ip\\Modify', 'update' => 'NethServer\\Template\\TrafficShaping\\Ip\\Modify', 'delete' => 'Nethgui\\Template\\Table\\Delete');
     $view->setTemplate($templates[$this->getIdentifier()]);
     $view['Source'] = $view['SrcRaw'] ? \NethServer\Module\FirewallRules\RuleGenericController::translateFirewallObjectTitle($view, $view['SrcRaw']) : '';
     $view['PriorityDatasource'] = array(array('1', $view->translate('1_label')), array('2', $view->translate('2_label')), array('3', $view->translate('3_label')));
 }
 private function addReadonlyAdapter(\Nethgui\View\ViewInterface $view, $targetName, $sourceName)
 {
     if (!isset($this->parameters[$targetName])) {
         return;
     }
     $this->parameters->addAdapter(new \Nethgui\Adapter\MultipleAdapter(function () use($view, $sourceName) {
         return \NethServer\Module\FirewallRules\RuleGenericController::translateFirewallObjectTitle($view, $view[$sourceName]);
     }), $targetName);
 }
Пример #3
0
 public function prepareView(\Nethgui\View\ViewInterface $view)
 {
     parent::prepareView($view);
     $templates = array('create' => 'NethServer\\Template\\PortForward\\Modify', 'update' => 'NethServer\\Template\\PortForward\\Modify', 'delete' => 'Nethgui\\Template\\Table\\Delete');
     $view->setTemplate($templates[$this->getIdentifier()]);
     $view['ProtoDatasource'] = array_map(function ($fmt) use($view) {
         return array($fmt, $view->translate($fmt . '_label'));
     }, $this->protocols);
     if (!$this->wanips) {
         $this->wanips = $this->readWanIPs();
     }
     $view['OriDstDatasource'] = array_map(function ($fmt) use($view) {
         return array($fmt, $fmt ? $fmt : $view->translate('any_label'));
     }, $this->wanips);
     $view['Destination'] = $view['DstRaw'] ? \NethServer\Module\FirewallRules\RuleGenericController::translateFirewallObjectTitle($view, $view['DstRaw']) : '';
 }
Пример #4
0
 public function prepareViewForColumnKey(\Nethgui\Controller\Table\Read $action, \Nethgui\View\ViewInterface $view, $key, $values, &$rowMetadata)
 {
     return \NethServer\Module\FirewallRules\RuleGenericController::translateFirewallObjectTitle($view, $key);
 }
Пример #5
0
 public function nextPath()
 {
     return $this->worker->nextPath();
 }