Exemple #1
0
 /**
  * Funkce pro smazání formátu
  */
 function delFormat()
 {
     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));
         unset($xml->MetaAttributes[0]->MetaAttribute[$maId]->Formats[0]->Format[$fId]);
         $model->save(JRequest::getInt('article'), $xml->asXML());
         $this->_redirect = 'index.php?option=com_bkef&task=metaAttribute&article=' . JRequest::getInt('article') . '&maId=' . $maId;
     } else {
         //zobrazime dotaz
         require_once JPATH_COMPONENT . DS . 'views' . DS . 'iframe' . DS . 'delFormat.html.php';
         $view = new BkefViewDelFormat();
         $view->xml = $model->load(JRequest::getInt('article'));
         $view->article = JRequest::getInt('article');
         $view->maId = JRequest::getInt('maId');
         $view->fId = JRequest::getInt('fId');
         $view->display();
     }
 }
Exemple #2
0
 /**
  * Funkce pro smazání formátu
  */
 function delFormat()
 {
     /*DONE_X*/
     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));
         //smazeme
         unset($xml->MetaAttributes[0]->MetaAttribute[$maId]->Formats[0]->Format[$fId]);
         //aktualizace data/casu posledni zmeny
         $xml->Header[0]->LastModified[0]->Timestamp = date('c');
         $xml->Header[0]->LastModified[0]->Author = $this->getUserName();
         $xml->MetaAttributes[0]->MetaAttribute[$maId]->LastModified[0]->Timestamp = date('c');
         $xml->MetaAttributes[0]->MetaAttribute[$maId]->LastModified[0]->Author = $this->getUserName();
         //save
         $model->save(JRequest::getInt('article'), $xml->asXML());
         $this->_redirect = 'index.php?option=com_bkef&task=metaAttribute&article=' . JRequest::getInt('article') . '&maId=' . $maId;
     } else {
         //zobrazime dotaz
         require_once JPATH_COMPONENT . DS . 'views' . DS . 'iframe' . DS . 'delFormat.html.php';
         $view = new BkefViewDelFormat();
         $view->xml = $model->load(JRequest::getInt('article'));
         $view->article = JRequest::getInt('article');
         $view->maId = JRequest::getInt('maId');
         $view->fId = JRequest::getInt('fId');
         $view->display();
     }
 }