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


PHP common_node::getParentPageId方法代码示例

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


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

示例1: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     /**
      * node_id is mandatory input
      */
     if (is_numeric($this->GET['node_id'])) {
         $node_id = $this->GET['node_id'];
     } else {
         msg("menu_prevnext: missing node_id", 'error');
         return false;
     }
     /**
      * get detail and list
      */
     $Node = new common_node();
     $first_parent_type_page_node_id = $Node->getParentPageId($node_id);
     $parent_page_detail = $Node->getDetail($first_parent_type_page_node_id);
     $current_node_detail = $Node->getDetail($node_id);
     if ($current_node_detail['node_group'] == 'page') {
         // the specific node_id is page type
         $current_page_detail = $current_node_detail;
         $parent_page_detail = $Node->getDetail($Node->getParentPageId($current_page_detail['parent']));
     } else {
         // we need to first parent type page
         $current_page_detail = $parent_page_detail;
         $parent_page_detail = $Node->getDetail($current_page_detail['parent']);
     }
     $siblings = $Node->listing("parent = {$current_page_detail['parent']} AND node_group = 'page' AND publish = 1", 'priority DESC, id ASC');
     if (is_array($siblings)) {
         /**
          * find prev/next node
          */
         foreach ($siblings as $k => $item) {
             if ($item['id'] == $current_page_detail['id']) {
                 $prev_node = $siblings[$k - 1];
                 $next_node = $siblings[$k + 1];
                 break;
             }
         }
         /**
          * cycle
          */
         if (!is_array($prev_node)) {
             $count = count($siblings);
             $prev_node = $siblings[$count - 1];
         }
         if (!is_array($next_node)) {
             $next_node = $siblings[0];
         }
     }
     /**
      * assign
      */
     $this->tpl->assign('PREV', $prev_node);
     $this->tpl->assign('ALL', $parent_page_detail);
     $this->tpl->assign('NEXT', $next_node);
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:61,代码来源:prevnext.php

示例2: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     /**
      * include node configuration
      */
     require_once 'models/common/common_node.php';
     $Node = new common_node();
     /**
      * nothing to do here, forward first parent page
      */
     $first_parent_page_id = $Node->getParentPageId($this->GET['id']);
     onxshopGoTo("page/" . $first_parent_page_id);
     return true;
 }
开发者ID:uralmax89,项目名称:onxshop,代码行数:17,代码来源:default.php

示例3: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     /**
      * include node configuration
      */
     require_once 'models/common/common_node.php';
     $Node = new common_node();
     /**
      * nothing to do here, forward first parent page
      */
     $first_parent_page_id = $Node->getParentPageId($this->GET['id']);
     if (is_numeric($first_parent_page_id) && $first_parent_page_id > 0) {
         onxshopGoTo("page/" . $first_parent_page_id);
     } else {
         // there is no parent page to this container, forward to homepage
         onxshopGoto("page/" . $Node->conf['id_map-homepage']);
     }
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:22,代码来源:default.php

示例4: displayNodeInfo

 /**
  * display detail for node
  */
 function displayNodeInfo($relations_list)
 {
     require_once 'models/common/common_node.php';
     $Node = new common_node();
     foreach ($relations_list as $image_detail) {
         $node_detail = $Node->detail($image_detail['node_id']);
         if ($node_detail['node_group'] != 'page') {
             $image_detail['page_id'] = $Node->getParentPageId($image_detail['node_id']);
         } else {
             $image_detail['page_id'] = $image_detail['node_id'];
         }
         $this->tpl->assign('NODE_DETAIL', $node_detail);
         $this->tpl->assign('IMAGE_DETAIL', $image_detail);
         $this->tpl->parse('content.usage.node');
     }
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:19,代码来源:file_usage.php


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