本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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');
}
}