Exemplo n.º 1
0
 /**
  * @return string
  */
 public function InitPostAction($sTab)
 {
     $sResult = false;
     if ($this->oStandardPostAction && $this->IsInTab($sTab)) {
         $sResult = '?root';
         $sPostId = CPost::Get('form_id', 'null');
         $sPostActionFunction = ucfirst($sTab) . ucfirst($sPostId);
         $sPostActionFunction .= 'collection' === $sPostId && null !== CPost::Get('action', null) ? ucfirst(CPost::Get('action', '')) : '';
         CApi::Log('call ' . get_class($this) . '->StandardPostAction->' . $sPostActionFunction . '()');
         if (!empty($sPostId) && method_exists($this->oStandardPostAction, $sPostActionFunction)) {
             $sActionResult = $this->oStandardPostAction->{$sPostActionFunction}();
             if (!empty($this->oStandardPostAction->LastError)) {
                 $this->oAdminPanel->ShowError($this->oStandardPostAction->LastError);
             } else {
                 if (!empty($this->oStandardPostAction->LastMessage)) {
                     $this->oAdminPanel->ShowMessage($this->oStandardPostAction->LastMessage);
                 }
             }
             if (empty($sActionResult)) {
                 $sResult = $sActionResult;
             }
         }
     }
     return $sResult;
 }