Exemplo n.º 1
0
 public function executeSavePage()
 {
     try {
         PanelService::objectSave($obj, $parent);
         Urlrewrite::updateUrlRelationCache();
         //UtilsHelper::setBackendMsg("Saved");
     } catch (Exception $e) {
         UtilsHelper::setBackendMsg("Error saving Page: " . $e->getMessage(), "error");
     }
     //		exec('rm -fr '.SF_ROOT_DIR.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'menus/*');
     //		PanelService::redirect();
     //		exit();
 }
Exemplo n.º 2
0
Arquivo: Page.php Projeto: kotow/work
 public function setRewriteUrl($value)
 {
     try {
         if (!$this->getId()) {
             $this->setId(Document::getGenericDocument($this)->getId());
         }
         $con = Propel::getConnection();
         $con->begin();
         //			$rewriteUrl = UrlrewritePeer::retrieveByPk($value);
         $c = new Criteria();
         $c->add(UrlrewritePeer::PAGE_ID, $this->getId());
         $rewriteUrl = UrlrewritePeer::doSelectOne($c);
         //$rewriteUrl = Document::getDocumentInstance($value);
         $value = trim($value);
         if ($rewriteUrl) {
             if ($value != '') {
                 $value = Urlrewrite::checkRewriteUrl($value, $this->getId());
                 $rewriteUrl->setLabel($value);
                 $rewriteUrl->save(null, $this);
             } else {
                 if ($value == '') {
                     $rewriteUrl->delete();
                 }
             }
         } else {
             if ($value) {
                 $value = Urlrewrite::checkRewriteUrl($value, $this->getId());
                 $rewriteUrl = new Urlrewrite();
                 $rewriteUrl->setLabel($value);
                 $rewriteUrl->setPageId($this->getId());
                 $rewriteUrl->save(null, $this);
             }
         }
         $con->commit();
         return true;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
     return true;
 }
Exemplo n.º 3
0
 /**
  * searchProcessAction
  * Search the record 
  * @return unknown_type
  */
 public function searchprocessAction()
 {
     $this->_helper->ajaxgrid->setConfig(Urlrewrite::grid())->search();
 }
Exemplo n.º 4
0
 public function executeSavePageI18n()
 {
     try {
         $pageType = $this->getRequestParameter("attrPageType");
         if (!$pageType) {
             $request = $this->getRequest();
             $request->setParameter('attrPageType', 'CONTENT');
         }
         BackendService::objectSave($obj, $parent);
         $obj->setRewriteUrl($this->getRequestParameter("attrRewriteUrl"));
         if (!$this->getRequestParameter("attrIsSecure")) {
             $obj->setIsSecure(NULL);
         }
         $obj->save(null, $parent, $this->getRequestParameter("attrCulture"));
         Urlrewrite::updateUrlRelationCache();
         UtilsHelper::setBackendMsg("Saved");
     } catch (Exception $e) {
         UtilsHelper::setBackendMsg("Error while saving: " . $e->getMessage(), "error");
     }
     $this->forward(strtolower($this->getRequestParameter('moduleName')), "edit" . $this->getRequestParameter('documentName'));
     exit;
 }