本文整理汇总了PHP中Sections::list_for_name方法的典型用法代码示例。如果您正苦于以下问题:PHP Sections::list_for_name方法的具体用法?PHP Sections::list_for_name怎么用?PHP Sections::list_for_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sections
的用法示例。
在下文中一共展示了Sections::list_for_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: join
$lines[] = Skin::build_link($context['url_to_home'] . $context['url_to_root'] . Files::get_url('section:' . $item['id'], 'feed'), i18n::s('Recent files'), 'xml');
// comments are allowed
if ($cur_section->allows('creation', 'comment')) {
$lines[] = Skin::build_link($context['url_to_home'] . $context['url_to_root'] . Comments::get_url('section:' . $item['id'], 'feed'), i18n::s('Recent comments'), 'xml');
}
}
// in a side box
if (count($lines)) {
$context['components']['channels'] = Skin::build_box(i18n::s('Monitor'), join(BR, $lines), 'channels', 'feeds');
}
// twin pages
if (isset($item['nick_name']) && $item['nick_name']) {
// build a complete box
$box['text'] = '';
// list pages with same name
$items = Sections::list_for_name($item['nick_name'], $item['id'], 'compact');
// actually render the html for the section
if (is_array($items)) {
$box['text'] .= Skin::build_list($items, 'compact');
}
if ($box['text']) {
$context['components']['twins'] = Skin::build_box(i18n::s('Related'), $box['text'], 'twins', 'twins');
}
}
// the contextual menu, in a navigation box, if this has not been disabled
if ((!is_object($anchor) || !$anchor->has_option('no_contextual_menu', FALSE)) && (!isset($item['options']) || !preg_match('/\\bno_contextual_menu\\b/i', $item['options'])) && isset($context['current_focus']) && ($menu =& Skin::build_contextual_menu($context['current_focus']))) {
// use title from topmost level
if (count($context['current_focus']) && ($topmost = Anchors::get($context['current_focus'][0]))) {
$box_title = $topmost->get_title();
$box_url = $topmost->get_url();
// generic title
示例2: load_skin
i18n::bind('root');
// load the skin
load_skin('go');
// the title of the page
$context['page_title'] = i18n::s('Page locator');
// ensure we have a non-empty string
if (!($id = trim($id)) || !preg_match('/\\w/', $id)) {
$context['text'] .= '<p>' . i18n::s('Please indicate a nick name to look for.') . "</p>\n";
// short link to some article
} elseif (!strncmp($id, 'a~', 2) && ($item = Articles::get(restore_number(substr($id, 2))))) {
Safe::redirect(Articles::get_permalink($item));
// short link to some section
} elseif (!strncmp($id, 's~', 2) && ($item = Sections::get(restore_number(substr($id, 2))))) {
Safe::redirect(Sections::get_permalink($item));
// look in sections
} elseif ($items =& Sections::list_for_name($id, NULL, 'full')) {
// only one section has this name
if (count($items) == 1) {
list($url, $attributes) = each($items);
Safe::redirect($url);
}
// splash
$context['text'] .= '<p>' . i18n::s('Select below among available sections.') . '</p>';
// several pages
$context['text'] .= Skin::build_list($items, 'decorated');
// look in categories
} elseif (($item = Categories::get($id)) || ($item =& Categories::get_by_keyword($id))) {
Safe::redirect(Categories::get_permalink($item));
// look in articles
} elseif ($items =& Articles::list_for_name($id, NULL, 'full')) {
// only one page has this name