当前位置: 首页>>代码示例>>PHP>>正文


PHP Pages::fetchRow方法代码示例

本文整理汇总了PHP中Pages::fetchRow方法的典型用法代码示例。如果您正苦于以下问题:PHP Pages::fetchRow方法的具体用法?PHP Pages::fetchRow怎么用?PHP Pages::fetchRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pages的用法示例。


在下文中一共展示了Pages::fetchRow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deleteAction

 function deleteAction()
 {
     $this->view->title = "Supprimer une page";
     // retrieve the ID of the parent page
     $PageID = $this->_getParam('ID');
     if (Cible_ACL::hasAccess($PageID)) {
         // generates tree by Language and send the result to the view
         Zend_Registry::set('baseUrl', $this->view->baseUrl());
         $this->view->TreeView = $this->view->getTreeView();
         if ($this->_request->isPost()) {
             //$PageID = (int)$this->_request->getPost('PageID');
             // if is set delete, then delete
             $delete = isset($_POST['delete']);
             if ($delete && $PageID > 0) {
                 Cible_FunctionsPages::deleteAllChildPage($PageID);
                 Cible_FunctionsPages::deleteAllBlock($PageID);
                 $pageSelect = new PagesIndex();
                 $select = $pageSelect->select()->where('PI_PageID = ?', $PageID);
                 $pageData = $pageSelect->fetchAll($select)->toArray();
                 foreach ($pageData as $page) {
                     $indexData['moduleID'] = 0;
                     $indexData['contentID'] = $PageID;
                     $indexData['languageID'] = $page['PI_LanguageID'];
                     $indexData['action'] = 'delete';
                     Cible_FunctionsIndexation::indexation($indexData);
                 }
                 $Page = new Pages();
                 $Where = 'P_ID = ' . $PageID;
                 $Page->delete($Where);
                 $PageIndex = new PagesIndex();
                 $Where = 'PI_PageID = ' . $PageID;
                 $PageIndex->delete($Where);
                 if (!$this->_request->isXmlHttpRequest()) {
                     $this->_redirect('/');
                 }
             } else {
                 if (!$this->_isXmlHttpRequest) {
                     $this->_redirect('/page/edit/ID/' . $PageID);
                 }
             }
         } else {
             if ($PageID > 0) {
                 $Page = new Pages();
                 $this->view->page = $Page->fetchRow('P_ID=' . $PageID);
                 $PageIndex = new PagesIndex();
                 $Select = $PageIndex->select()->where("PI_PageID = ?", $PageID)->where("PI_LanguageID = ?", $this->_defaultEditLanguage);
                 $this->view->pageindex = $PageIndex->fetchRow($Select);
             }
         }
     }
 }
开发者ID:anunay,项目名称:stentors,代码行数:51,代码来源:ManageController.php

示例2: getHomePageDetails

 public static function getHomePageDetails()
 {
     $pagesSelect = new Pages();
     $select = $pagesSelect->select()->setIntegrityCheck(false)->from('Pages')->join('PagesIndex', 'PI_PageID = P_ID')->where('PI_LanguageID = ?', Zend_Registry::get('languageID'))->where('P_Home = 1');
     return $pagesSelect->fetchRow($select)->toArray();
 }
开发者ID:anunay,项目名称:stentors,代码行数:6,代码来源:FunctionsPages.php

示例3: deleteAction

 function deleteAction()
 {
     $this->view->title = "Delete Pages";
     $pages = new Pages();
     if ($this->_request->isPost()) {
         Zend_Loader::loadClass('Zend_Filter_Alpha');
         $filter = new Zend_Filter_Alpha();
         $id = (int) $this->_request->getPost('id');
         $del = $filter->filter($this->_request->getPost('del'));
         if ($del == 'Yes' && $id > 0) {
             $where = 'id = ' . $id;
             $rows_affected = $pages->delete($where);
         }
     } else {
         $id = (int) $this->_request->getParam('id');
         if ($id > 0) {
             // only render if we have an id and can find the pages.
             $this->view->pages = $pages->fetchRow('id=' . $id);
             if ($this->view->pages->id > 0) {
                 // render template automatically
                 return;
             }
         }
     }
     // redirect back to the pages list unless we have rendered the view
     $this->_redirect('/admin');
 }
开发者ID:stasiu38,项目名称:cms,代码行数:27,代码来源:AdminController.php

示例4: deleteBlockAction

 public function deleteBlockAction()
 {
     // variables
     $_pageID = (int) $this->_getParam('ID');
     $_blockID = (int) $this->_getParam('blockID');
     if (Cible_ACL::hasAccess($_pageID)) {
         if ($this->_request->isPost()) {
             // if is set delete, then delete
             $delete = isset($_POST['delete']);
             if ($delete && $_blockID > 0) {
                 // never remove the news themselves
                 /* DELETE ROW IN BLOCK TABLE(S)   */
                 if (method_exists($this, 'delete')) {
                     $this->delete($_blockID);
                 }
                 $this->deleteBlock($_blockID);
                 if ($this->_isXmlHttpRequest) {
                     $this->disableView();
                     echo Zend_Json::encode(array('result' => true));
                     return;
                 }
             }
             $this->_redirect('/page/manage/index/ID/' . $_pageID);
         } else {
             if ($_pageID > 0) {
                 // get page information
                 $page = new Pages();
                 $this->view->page = $page->fetchRow('P_ID=' . $_pageID);
                 $pageIndex = new PagesIndex();
                 $select = $pageIndex->select()->where("PI_PageID = ?", $_pageID)->where("PI_LanguageID = ?", Zend_Registry::get("languageID"));
                 $this->view->pageIndex = $pageIndex->fetchRow($select);
                 // get block information
                 $blockIndex = new BlocksIndex();
                 $select = $blockIndex->select()->where('BI_BlockID = ?', $_blockID)->where('BI_LanguageID = ?', Zend_Registry::get("languageID"));
                 $this->view->blockIndex = $blockIndex->fetchRow($select);
             }
         }
     }
 }
开发者ID:anunay,项目名称:stentors,代码行数:39,代码来源:Abstract.php


注:本文中的Pages::fetchRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。