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


PHP Pages::select方法代码示例

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


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

示例1: indexAction

 function indexAction()
 {
     // retrieve the ID of the requested page
     $pageID = $this->view->pageID = $this->_getParam('ID');
     $pageDetails = new PagesIndex();
     $pageDetailsSelect = $pageDetails->select();
     $pageDetailsSelect->where('PI_PageID = ?', $pageID)->where('PI_LanguageID = ?', $this->_defaultEditLanguage);
     $pageDetailsData = $pageDetails->fetchRow($pageDetailsSelect)->toArray();
     $this->view->assign("pageTitle", $pageDetailsData["PI_PageTitle"]);
     $authData = $this->view->user;
     $authID = $authData['EU_ID'];
     if (Cible_FunctionsAdministrators::checkAdministratorPageAccess($authID, $pageID, "data")) {
         $authData = $this->view->user;
         $authID = $authData['EU_ID'];
         if (Cible_FunctionsAdministrators::checkAdministratorPageAccess($authID, $pageID, "structure")) {
             $this->view->assign('hasAccessToStructure', true);
         }
         // Retrieve the page view layout
         $page = new Pages();
         $page_select = $page->select()->setIntegrityCheck(false);
         $page_select->from('Pages')->join('Views', 'Pages.P_ViewID = Views.V_ID')->where('P_ID = ?', $pageID);
         $page_info = Cible_FunctionsPages::getPageViewDetails($pageID);
         $template_file = 'index/' . $page_info['V_Path'];
         $_zone_count = $page_info['V_ZoneCount'];
         // make a request to get all the blocks to be displayed
         $blocks = new Blocks();
         $select = $blocks->select()->setIntegrityCheck(false);
         $select->from('Blocks')->join('Modules', 'Modules.M_ID = Blocks.B_ModuleID')->join('Pages', 'Blocks.B_PageID = P_ID')->join('BlocksIndex', 'Blocks.B_ID = BlocksIndex.BI_BlockID')->where('Blocks.B_PageID = ?', $pageID)->where('BlocksIndex.BI_LanguageID = ?', Zend_Registry::get('languageID'))->order('Blocks.B_Position ASC');
         //Send the results to the view
         $rows = $blocks->fetchAll($select);
         $_blocks = array();
         foreach ($rows as $row) {
             // create the placeholder object if not already defined
             if (!isset($_blocks[$row['B_ZoneID']])) {
                 $_blocks[$row['B_ZoneID']] = array();
             }
             $_blocks[$row['B_ZoneID']][] = $row->toArray();
         }
         $this->view->assign('template_file', $template_file);
         $this->view->assign('zone_count', $_zone_count);
         $this->view->assign('blocks', $_blocks);
         // Load the modules in the view
         $Modules = new Modules();
         $modules = $Modules->fetchAll();
         $this->view->assign('modules', $modules->toArray());
     } else {
         $this->view->assign('template_file', "");
         $this->view->assign('error_message_permission', $this->view->getCibleText('error_message_permission'));
     }
 }
开发者ID:anunay,项目名称:stentors,代码行数:50,代码来源:IndexController.php

示例2: autogenerateMenuItemFromPageId

 private function autogenerateMenuItemFromPageId($itemId, $parentId, $recursive = false)
 {
     $pageObject = new Pages();
     $select = $pageObject->select()->setIntegrityCheck(false)->from('Pages')->joinInner('PagesIndex', 'PI_PageID = P_ID')->where('PI_LanguageID = ?', Zend_Registry::get('languageID'))->where('P_ParentID = ?', $parentId)->order('P_Position');
     $pages = $pageObject->fetchAll($select)->toArray();
     foreach ($pages as $item) {
         $page_id = $item['P_ID'];
         $position = $this->_db->fetchCol("SELECT count(*) FROM MenuItemData WHERE MID_ParentID = '{$itemId}' AND MID_MenuID = '{$this->_id}'");
         $position = $position[0];
         $langs = Cible_FunctionsGeneral::getAllLanguage();
         foreach ($langs as $lang) {
             $page_details = Cible_FunctionsPages::getPageDetails($page_id, $lang['L_ID']);
             $page_title = !empty($page_details['PI_PageTitle']) ? $page_details['PI_PageTitle'] : null;
             if ($page_title != null) {
                 $found_status = $this->autogenerate_checkIfAlreadyExists($itemId, $page_id, $lang['L_ID']);
                 if (!$found_status['data']) {
                     $menuData = new MenuItem();
                     $_data = $menuData->createRow();
                     $_data->setFromArray(array('MID_MenuID' => $this->_id, 'MID_ParentID' => $itemId, 'MID_Position' => $position));
                     $_data->save();
                     $_dataId = $this->_db->lastInsertId();
                     $menuIndex = new MenuItemIndex();
                     $_index = $menuIndex->createRow();
                     $_index->setFromArray(array('MII_LanguageID' => $item['PI_LanguageID'], 'MII_MenuItemDataID' => $_dataId, 'MII_Title' => $page_title, 'MII_Link' => '', 'MII_PageID' => $page_id));
                     $_index->save();
                 } else {
                     if ($found_status['data'] && !$found_status['lang']) {
                         $_dataId = $found_status['dataID'];
                         $menuIndex = new MenuItemIndex();
                         $_index = $menuIndex->createRow();
                         $_index->setFromArray(array('MII_LanguageID' => $lang['L_ID'], 'MII_MenuItemDataID' => $_dataId, 'MII_Title' => $page_title, 'MII_Link' => '', 'MII_PageID' => $page_id));
                         $_index->save();
                     }
                 }
             }
         }
         if ($_dataId != -1 && $recursive) {
             $this->autogenerateMenuItemFromPageId($_dataId, $page_id, $recursive);
         }
     }
 }
开发者ID:anunay,项目名称:stentors,代码行数:41,代码来源:MenuObject.php

示例3: 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

示例4: elseif

<?php

require_once 'config.php';
$meta = Meta::select('section', $_GET['name_en']);
$pages = Pages::select($_GET['name_en']);
include 'view/tpl_top.php';
include 'view/tpl_header.php';
include 'view/tpl_nav.php';
?>
<div class="container main-container">
    <div class="row">
        <div class="col-lg-9 col-md-9 col-sm-12">
            <div class="col-lg-12 col-sm-12">
                <span class="title"><?php 
echo $pages[0]['name'];
?>
</span>
            </div>
            <div class="col-lg-12 col-sm-12 hero-feature">
                <?php 
echo $pages[0]['text'];
?>
                <?php 
if ($_GET['name_en'] == "contact") {
    echo Config::maps();
} elseif ($_GET['name_en'] == "certificate") {
    ?>
                        <div class="col-lg-4 col-sm-4 hero-feature text-center">
                            <div class="thumbnail">
                                <a class="fancybox link-p cat" href="/images/certificate/1/1.jpg" data-fancybox-group="gallery1" style="overflow: hidden; position: relative;">
                                    <img src="/images/certificate/1/1.jpg" style="position: absolute; width: 242px; height: 346px; max-width: none; max-height: none; left: 0px; top: 0px;" class="def-img">
开发者ID:Torredo,项目名称:autozip,代码行数:31,代码来源:pages.php


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