コード例 #1
0
ファイル: controller.php プロジェクト: KIZI/sewebar-cms
 /**
  * Funkce pro přidání PreprocessingHint
  */
 function renamePreprocessingHint()
 {
     require_once JPATH_COMPONENT . DS . 'models' . DS . 'bkef.php';
     $model = new BkefModel();
     if ($_POST['potvrzeni'] == 1) {
         //skutecne smazeme
         $xml = $model->load(JRequest::getInt('article'));
         $maId = intval(JRequest::getInt('maId', -1));
         $fId = intval(JRequest::getInt('fId', -1));
         $phId = JRequest::getInt('phId');
         $preprocessingHint = $xml->MetaAttributes[0]->MetaAttribute[$maId]->Formats[0]->Format[$fId]->PreprocessingHints[0]->PreprocessingHint[$phId];
         $preprocessingHint['name'] = JRequest::getString('name');
         $model->save(JRequest::getInt('article'), $xml->asXML());
         $this->_redirect = 'index.php?option=com_bkef&task=format&article=' . JRequest::getInt('article') . '&maId=' . $maId . '&fId=' . $fId . '#preprocessingHints';
     } else {
         //zobrazime dotaz
         require_once JPATH_COMPONENT . DS . 'views' . DS . 'iframe' . DS . 'renamePreprocessingHint.html.php';
         $view = new BkefViewRenamePreprocessingHint();
         $view->xml = $model->load(JRequest::getInt('article'));
         $view->article = JRequest::getInt('article');
         $view->maId = JRequest::getInt('maId');
         $view->fId = JRequest::getInt('fId');
         $view->phId = JRequest::getInt('phId');
         $view->display();
     }
 }
コード例 #2
0
ファイル: controller.php プロジェクト: KIZI/sewebar-cms
 /**
  * Funkce pro pre PreprocessingHint
  */
 function renamePreprocessingHint()
 {
     require_once JPATH_COMPONENT . DS . 'models' . DS . 'bkef.php';
     $model = new BkefModel();
     if ($_POST['potvrzeni'] == 1) {
         //skutecne ukladame
         $xml = $model->load(JRequest::getInt('article'));
         $maId = intval(JRequest::getInt('maId', -1));
         $fId = intval(JRequest::getInt('fId', -1));
         $phId = JRequest::getInt('phId');
         //aktualizace nazvu
         $discretizationHint = $xml->MetaAttributes[0]->MetaAttribute[$maId]->Formats[0]->Format[$fId]->PreprocessingHints[0]->DiscretizationHint[$phId];
         $discretizationHint->Name = JRequest::getString('name');
         //aktualizace data/casu posledni zmeny
         $xml->Header[0]->LastModified[0]->Author = $this->getUserName();
         $xml->Header[0]->LastModified[0]->Timestamp = date('c');
         $xml->MetaAttributes[0]->MetaAttribute[$maId]->LastModified[0]->Author = $this->getUserName();
         $xml->MetaAttributes[0]->MetaAttribute[$maId]->LastModified[0]->Timestamp = date('c');
         $xml->MetaAttributes[0]->MetaAttribute[$maId]->Formats[0]->Format[$fId]->LastModified[0]->Author = $this->getUserName();
         $xml->MetaAttributes[0]->MetaAttribute[$maId]->Formats[0]->Format[$fId]->LastModified[0]->Timestamp = date('c');
         $dicretizationHint->LastModified[0]->Timestamp = date('c');
         $discretizationHint->LastModified[0]->Author = $this->getUserName();
         //save
         $model->save(JRequest::getInt('article'), $xml->asXML());
         $this->_redirect = 'index.php?option=com_bkef&task=format&article=' . JRequest::getInt('article') . '&maId=' . $maId . '&fId=' . $fId . '#preprocessingHints';
     } else {
         //zobrazime dotaz
         require_once JPATH_COMPONENT . DS . 'views' . DS . 'iframe' . DS . 'renamePreprocessingHint.html.php';
         $view = new BkefViewRenamePreprocessingHint();
         $view->xml = $model->load(JRequest::getInt('article'));
         $view->article = JRequest::getInt('article');
         $view->maId = JRequest::getInt('maId');
         $view->fId = JRequest::getInt('fId');
         $view->phId = JRequest::getInt('phId');
         $view->display();
     }
 }