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


PHP PageManager::fetchPageByID方法代码示例

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


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

示例1: view

 public function view()
 {
     if (!($prototype_id = (int) $_GET['prototype_id'])) {
         $this->_status = self::STATUS_BAD;
         $this->_Result = json_encode(array('status' => __('Missing or wrong parameter.')));
         return;
     }
     $fields = PageManager::fetchPageByID($prototype_id);
     // return datasources and events as arrays
     $fields['data_sources'] = explode(',', $fields['data_sources']);
     $fields['events'] = explode(',', $fields['events']);
     // remove "prototype" from the type array and reorder
     $fields['type'] = array_values(array_diff($fields['type'], array('prototype')));
     $this->_Result = json_encode($fields);
 }
开发者ID:klaftertief,项目名称:page_prototypes,代码行数:15,代码来源:content.ajaxpageprototypes.php

示例2: updatePagesOfPrototype

 public static function updatePagesOfPrototype($prototype_id, $types)
 {
     if (empty($prototype_id)) {
         return;
     }
     $prototype = PageManager::fetchPageByID($prototype_id);
     $pages = self::fetchPagesOfPrototype($prototype_id);
     $fields = array();
     if (is_array($pages) && !empty($pages)) {
         foreach ($pages as $page) {
             $fields['params'] = $prototype['params'];
             $fields['events'] = $prototype['events'];
             $fields['data_sources'] = $prototype['data_sources'];
             PageManager::edit($page['id'], $fields, true);
             PageManager::addPageTypesToPage($page['id'], array_values(array_diff($types, array('prototype'))));
         }
     }
 }
开发者ID:klaftertief,项目名称:page_prototypes,代码行数:18,代码来源:class.pageprototypes.php

示例3: delete

 /**
  * This function takes a Page ID and removes the Page from the database
  * in `tbl_pages` and it's associated Page Types in `tbl_pages_types`.
  * This function does not delete any of the Page's children.
  *
  * @see toolkit.PageManager#deletePageTypes
  * @see toolkit.PageManager#deletePageFiles
  * @param integer $page_id
  *  The ID of the Page that should be deleted.
  * @param boolean $delete_files
  *  If true, this parameter will remove the Page's templates from the
  *  the filesystem. By default this is true.
  * @return boolean
  */
 public static function delete($page_id = null, $delete_files = true)
 {
     if (!is_int($page_id)) {
         return false;
     }
     $can_proceed = true;
     // Delete Files (if told to)
     if ($delete_files) {
         $page = PageManager::fetchPageByID($page_id, array('path', 'handle'));
         if (empty($page)) {
             return false;
         }
         $can_proceed = PageManager::deletePageFiles($page['path'], $page['handle']);
     }
     // Delete from tbl_pages/tbl_page_types
     if ($can_proceed) {
         PageManager::deletePageTypes($page_id);
         Symphony::Database()->delete('tbl_pages', sprintf(" `id` = %d ", $page_id));
         Symphony::Database()->query(sprintf("\n\t\t\t\t\t\tUPDATE\n\t\t\t\t\t\t\ttbl_pages\n\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t`sortorder` = (`sortorder` + 1)\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t`sortorder` < %d\n\t\t\t\t\t", $page_id));
     }
     return $can_proceed;
 }
开发者ID:nickdunn,项目名称:elasticsearch-surfin-shakespeare,代码行数:36,代码来源:class.pagemanager.php

示例4: __actionDelete

 public function __actionDelete($pages, $redirect)
 {
     $success = true;
     $deleted_page_ids = array();
     if (!is_array($pages)) {
         $pages = array($pages);
     }
     /**
      * Prior to deleting Pages
      *
      * @delegate PagePreDelete
      * @since Symphony 2.2
      * @param string $context
      * '/blueprints/pages/'
      * @param array $page_ids
      *  An array of Page ID's that are about to be deleted, passed
      *  by reference
      * @param string $redirect
      *  The absolute path that the Developer will be redirected to
      *  after the Pages are deleted
      */
     Symphony::ExtensionManager()->notifyMembers('PagePreDelete', '/blueprints/pages/', array('page_ids' => &$pages, 'redirect' => &$redirect));
     foreach ($pages as $page_id) {
         $page = PageManager::fetchPageByID($page_id);
         if (empty($page)) {
             $success = false;
             $this->pageAlert(__('Page could not be deleted because it does not exist.'), Alert::ERROR);
             break;
         }
         if (PageManager::hasChildPages($page_id)) {
             $this->_hilights[] = $page['id'];
             $success = false;
             $this->pageAlert(__('Page could not be deleted because it has children.'), Alert::ERROR);
             continue;
         }
         if (!PageManager::deletePageFiles($page['path'], $page['handle'])) {
             $this->_hilights[] = $page['id'];
             $success = false;
             $this->pageAlert(__('One or more pages could not be deleted.') . ' ' . __('Please check permissions on %s.', array('<code>/workspace/pages</code>')), Alert::ERROR);
             continue;
         }
         if (PageManager::delete($page_id, false)) {
             $deleted_page_ids[] = $page_id;
         }
     }
     if ($success) {
         /**
          * Fires after all Pages have been deleted
          *
          * @delegate PagePostDelete
          * @since Symphony 2.3
          * @param string $context
          * '/blueprints/pages/'
          * @param array $page_ids
          *  The page ID's that were just deleted
          */
         Symphony::ExtensionManager()->notifyMembers('PagePostDelete', '/blueprints/pages/', array('page_ids' => $deleted_page_ids));
         redirect($redirect);
     }
 }
开发者ID:davjand,项目名称:codecept-symphonycms-db,代码行数:60,代码来源:content.blueprintspages.php

示例5: setPageDetails

 public function setPageDetails($page_id)
 {
     $page = PageManager::fetchPageByID($page_id);
     if (count($page) == 0) {
         $this->set('page_title', __('Invalid or missing Page'));
         $this->set('page_uri', __('Invalid or missing Page'));
     } else {
         $this->set('page_title', $page['title']);
         $this->set('page_uri', URL . '/' . $page['path'] . '/' . $page['handle']);
         $this->set('page_events', $page['events']);
         $this->set('page_params', $page['params']);
     }
 }
开发者ID:rheingolden,项目名称:restengine,代码行数:13,代码来源:class.restresource.php


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