示例#1
0
 /**
  * řešení
  */
 function ajaxify()
 {
     $action = $this->webPage->getRequestValue('action');
     if ($action) {
         if ($this->controlColumns()) {
             switch ($action) {
                 case 'delete':
                     if ($this->controlDeleteColumns()) {
                         $this->fallBackUrl = false;
                         if ($this->deleteFromMySQL()) {
                             $this->webPage->addStatusMessage(_('Smazáno'));
                         }
                     }
                     break;
                 case 'add':
                     if ($this->controlAddColumns()) {
                         if ($this->insertToMySQL()) {
                             $this->webPage->addStatusMessage(_('Záznam byl přidán'), 'success');
                         } else {
                             $this->webPage->addStatusMessage(_('Záznam nebyl přidám'), 'error');
                         }
                     }
                     break;
                 case 'edit':
                     if ($this->controlEditColumns()) {
                         if ($this->saveToMySQL()) {
                             $this->webPage->addStatusMessage(_('Záznam byl upraven'), 'success');
                         } else {
                             $this->webPage->addStatusMessage(_('Záznam nebyl upravn'), 'error');
                         }
                     }
                     break;
                 default:
                     break;
             }
         }
         if ($this->fallBackUrl) {
             $this->webPage->redirect(EasePage::arrayToUrlParams($this->fallBackData, $this->fallBackUrl));
             exit;
         }
     }
 }