Esempio n. 1
0
 protected function establishCurrentActionId()
 {
     $request = $this->getRequest();
     $params = array();
     if ($request->hasParameter('create')) {
         $params = $request->getParameter('create');
         $action = 'create';
     } elseif ($request->hasParameter('update')) {
         if ($request->isMutation()) {
             $params = $request->getParameter('update');
         } else {
             $subRequest = $request->spawnRequest('update');
             $params = $subRequest->getParameter(\Nethgui\array_head($subRequest->getPath()));
         }
         $action = implode('/', $request->getPath());
     }
     if (isset($params['PickSource']) && $request->isMutation()) {
         $this->getAction('SaveState')->setField('SrcRaw')->setReturnPath($action)->setResumeState($params);
         return 'SaveState';
     }
     $this->myCurrentAction = parent::establishCurrentActionId();
     if (isset($params['f'], $params['h']) && !$request->isMutation()) {
         $this->getAction('SaveState')->setResumeCallback(function (\Nethgui\View\ViewInterface $view, $state) {
             $view['Priority'] = $state['Priority'];
             $view['Description'] = $state['Description'];
             $view['SrcRaw'] = $state['SrcRaw'];
             $view['Source'] = \NethServer\Module\FirewallRules\RuleGenericController::translateFirewallObjectTitle($view, $state['SrcRaw']);
             $view->getCommandList()->show();
         });
     }
     return $this->myCurrentAction;
 }