本文整理汇总了PHP中Sections::get_url方法的典型用法代码示例。如果您正苦于以下问题:PHP Sections::get_url方法的具体用法?PHP Sections::get_url怎么用?PHP Sections::get_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sections
的用法示例。
在下文中一共展示了Sections::get_url方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sprintf
if ($context['root_articles_layout'] == 'alistapart') {
$input .= ' checked="checked"';
}
$input .= '/>alistapart - ' . i18n::s('Display only the most recent published page. Previous articles may be accessed through a menu. This layout is suitable for sites with a low number of heavy publications.') . ' ' . Skin::build_link('skins/layout_home_articles_as_alistapart.jpg', i18n::s('Preview'), 'open') . BR;
// custom
$input .= '<input type="radio" name="root_articles_layout" value="custom" id="custom_articles_layout"';
if ($context['root_articles_layout'] == 'custom') {
$input .= ' checked="checked"';
}
$input .= '/> ' . sprintf(i18n::s('Use the customized layout %s'), '<input type="text" name="home_custom_layout" value="' . encode_field($custom_layout) . '" size="32" onfocus="$(\'#custom_articles_layout\').attr(\'checked\', \'checked\')" />') . BR;
// no article
$input .= '<p><input type="radio" name="root_articles_layout" value="no_articles"';
if ($context['root_articles_layout'] == 'no_articles') {
$input .= ' checked="checked"';
}
$input .= '/>' . sprintf(i18n::s('Do not list recent pages. The layout of the front page is solely based on a %s, on %s, plus %s.'), Skin::build_link(Sections::get_url('covers'), i18n::s('cover article'), 'shortcut'), Skin::build_link('sections/', i18n::s('the site map'), 'shortcut'), Skin::build_link(Sections::get_url('gadget_boxes'), i18n::s('gadget boxes'), 'shortcut')) . '</p>';
// number of entries at the front page
if (!isset($context['root_articles_count_at_home'])) {
$context['root_articles_count_at_home'] = '';
}
$input .= '<p>' . sprintf(i18n::s('Display %s articles at the front page. Put a number if you wish to override the default value for the selected layout.'), '<input type="text" name="root_articles_count_at_home" size="2" value="' . encode_field($context['root_articles_count_at_home']) . '" maxlength="4" />') . '</p>';
$fields[] = array($label, $input);
// build the form
$main .= Skin::build_form($fields);
$fields = array();
// the extra panel
//
$extra = '';
// featured articles can be either a static or an animated list
$label = i18n::s('Featured');
if (!isset($context['root_featured_count']) || $context['root_featured_count'] < 1 || $context['root_featured_count'] > 7) {
示例2: array
} else {
$context['text'] .= '<p>' . i18n::s('No message has been sent') . '</p>';
}
// back to the section page
$menu = array();
$menu[] = Skin::build_link(Sections::get_permalink($item), i18n::s('Done'), 'button');
$context['text'] .= Skin::finalize_list($menu, 'assistant_bar');
// a form to send an invitation to several people
} else {
// the form to send a message
$context['text'] .= '<form method="post" action="' . $context['script_url'] . '" onsubmit="return validateDocumentPost(this)" id="main_form"><div>';
$fields = array();
// additional fields for anonymous surfers
if (!Surfer::is_logged()) {
// splash
$login_url = $context['url_to_root'] . 'users/login.php?url=' . urlencode(Sections::get_url($item['id'], 'invite'));
$context['text'] .= '<p>' . sprintf(i18n::s('If you have previously registered to this site, please %s. Then the server will automatically put your name and address in following fields.'), Skin::build_link($login_url, i18n::s('authenticate'))) . "</p>\n";
// the name, if any
$label = i18n::s('Your name');
$input = '<input type="text" name="edit_name" size="45" maxlength="128" accesskey="n" value="' . encode_field(Surfer::get_name(' ')) . '" />';
$hint = i18n::s('Let us a chance to know who you are');
$fields[] = array($label, $input, $hint);
// the address, if any
$label = i18n::s('Your e-mail address');
$input = '<input type="text" name="edit_address" size="45" maxlength="128" accesskey="a" value="' . encode_field(Surfer::get_email_address()) . '" />';
$hint = i18n::s('Put your e-mail address to receive feed-back');
$fields[] = array($label, $input, $hint);
// stop robots
if ($field = Surfer::get_robot_stopper()) {
$fields[] = $field;
}
示例3:
// access previous versions, if any
if ($has_versions) {
Skin::define_img('SECTIONS_VERSIONS_IMG', 'sections/versions.gif');
$context['page_tools'][] = Skin::build_link(Versions::get_url('section:' . $item['id'], 'list'), SECTIONS_VERSIONS_IMG . i18n::s('Versions'), 'basic', i18n::s('Restore a previous version if necessary'));
}
// lock the page
if (!isset($item['locked']) || $item['locked'] == 'N') {
Skin::define_img('SECTIONS_LOCK_IMG', 'sections/lock.gif');
$context['page_tools'][] = Skin::build_link(Sections::get_url($item['id'], 'lock'), SECTIONS_LOCK_IMG . i18n::s('Lock'), 'basic');
} else {
Skin::define_img('SECTIONS_UNLOCK_IMG', 'sections/unlock.gif');
$context['page_tools'][] = Skin::build_link(Sections::get_url($item['id'], 'lock'), SECTIONS_UNLOCK_IMG . i18n::s('Unlock'), 'basic');
}
// delete the page
Skin::define_img('SECTIONS_DELETE_IMG', 'sections/delete.gif');
$context['page_tools'][] = Skin::build_link(Sections::get_url($item['id'], 'delete'), SECTIONS_DELETE_IMG . i18n::s('Delete this section'), 'basic');
// manage content
if ($has_content) {
Skin::define_img('SECTIONS_MANAGE_IMG', 'sections/manage.gif');
$context['page_tools'][] = Skin::build_link(Sections::get_url($item['id'], 'manage'), SECTIONS_MANAGE_IMG . i18n::s('Manage content'), 'basic', i18n::s('Bulk operations'));
}
// duplicate command provided to container owners
Skin::define_img('SECTIONS_DUPLICATE_IMG', 'sections/duplicate.gif');
$context['page_tools'][] = Skin::build_link(Sections::get_url($item['id'], 'duplicate'), SECTIONS_DUPLICATE_IMG . i18n::s('Duplicate this section'));
}
// use date of last modification into etag computation
if (isset($item['edit_date'])) {
$context['page_date'] = $item['edit_date'];
}
// render the skin
render_skin();
示例4: get_permalink
/**
* get permanent address
*
* @param array page attributes
* @return string the permanent web address to this item, relative to the installation path
*/
public static function get_permalink($item)
{
global $context;
// sanity check
if (!isset($item['id'])) {
throw new Exception('bad input parameter');
}
// get host to this page
$vhost = Sections::get_vhost('section:' . $item['id']);
// if top-level section with bounded vhost, provide a root link
if ((!isset($item['anchor']) || !$item['anchor']) && file_exists($context['path_to_root'] . 'parameters/virtual_' . $item['nick_name'] . '.include.php')) {
return $vhost;
}
// absolute link
return $vhost . Sections::get_url($item['id'], 'view', $item['title'], isset($item['nick_name']) ? $item['nick_name'] : '');
}
示例5: sprintf
}
// content assistant
if (Surfer::is_associate()) {
$commands[] = sprintf(i18n::s('%s - create blogs, wikis, forums, and more'), Skin::build_link('help/populate.php', i18n::s('Content Assistant'), 'basic'));
}
// site map
if (Surfer::is_associate()) {
$commands[] = sprintf(i18n::s('%s - you may enhance %s of some sections'), Skin::build_link('sections/', i18n::s('Site map')), '<a href="../behaviors/">' . i18n::s('behaviors') . '</a>');
}
// template pages
if (Surfer::is_associate()) {
$commands[] = sprintf(i18n::s('%s - some have %s'), Skin::build_link(Sections::get_url('templates'), i18n::s('Template pages')), '<a href="../overlays/">' . i18n::s('overlays') . '</a>');
}
// global pages
if (Surfer::is_associate()) {
$commands[] = sprintf(i18n::s('%s, including: %s, %s, %s and %s'), Skin::build_link(Sections::get_url('global'), i18n::s('Global pages')), Skin::build_link(Articles::get_url('cover'), i18n::s('the cover page')), Skin::build_link(Articles::get_url('menu'), i18n::s('Menu')), Skin::build_link(Articles::get_url('about'), i18n::s('About this site')), Skin::build_link(Articles::get_url('privacy'), i18n::s('Privacy statement')));
}
// import some content
if (Surfer::is_associate()) {
$commands[] = sprintf(i18n::s('%s - exported from another server'), Skin::build_link('control/import.php', i18n::s('Import XML content'), 'basic'));
}
// upload some CSV
if (Surfer::is_associate()) {
$commands[] = sprintf(i18n::s('%s - update the database'), Skin::build_link('tables/import.php', i18n::s('Upload a .CSV file'), 'basic'));
}
// available feeds
$commands[] = sprintf(i18n::s('%s - all feeds available (RSS, ATOM)'), Skin::build_link('feeds/', i18n::s('Information channels'), 'basic'));
// web services
$commands[] = sprintf(i18n::s('%s - connect remote computers through XML-RPC or REST'), Skin::build_link('services/', i18n::s('Web services'), 'basic'));
// codes
$commands[] = sprintf(i18n::s('%s - codes you can use to beautify your pages'), Skin::build_link('codes/', i18n::s('Codes'), 'basic'));
示例6: layout
//.........这里部分代码省略.........
$suffix .= BR . Codes::beautify_introduction($item['introduction']);
}
// insert overlay data, if any
if (is_object($overlay)) {
$suffix .= $overlay->get_text('list', $item);
}
// append details to the suffix
$suffix .= BR . '<span class="details">';
// details
$details = array();
// info on related pages
$stats = Articles::stat_for_anchor('section:' . $item['id']);
if ($stats['count']) {
$details[] = sprintf(i18n::ns('%d page', '%d pages', $stats['count']), $stats['count']);
}
// info on related files
$stats = Files::stat_for_anchor('section:' . $item['id']);
if ($stats['count']) {
$details[] = sprintf(i18n::ns('%d file', '%d files', $stats['count']), $stats['count']);
}
// info on related links
$stats = Links::stat_for_anchor('section:' . $item['id']);
if ($stats['count']) {
$details[] = sprintf(i18n::ns('%d link', '%d links', $stats['count']), $stats['count']);
}
// info on related comments
$stats = Comments::stat_for_anchor('section:' . $item['id']);
if ($stats['count']) {
$details[] = sprintf(i18n::ns('%d comment', '%d comments', $stats['count']), $stats['count']);
}
// info on related sections
$stats = Sections::stat_for_anchor('section:' . $item['id']);
if ($stats['count']) {
$details[] = sprintf(i18n::ns('%d section', '%d sections', $stats['count']), $stats['count']);
}
// combine in-line details
if (count($details)) {
$suffix .= ucfirst(trim(implode(', ', $details))) . BR;
}
// list up to three categories by title, if any
$anchors = array();
if ($members =& Members::list_categories_by_title_for_member('section:' . $item['id'], 0, 7, 'raw')) {
foreach ($members as $id => $attributes) {
// add background color to distinguish this category against others
if (isset($attributes['background_color']) && $attributes['background_color']) {
$attributes['title'] = '<span style="background-color: ' . $attributes['background_color'] . '; padding: 0 3px 0 3px;">' . $attributes['title'] . '</span>';
}
$anchors[] = Skin::build_link(Categories::get_permalink($attributes), $attributes['title'], 'basic');
}
}
if (count($anchors)) {
$suffix .= sprintf(i18n::s('In %s'), implode(' | ', $anchors)) . BR;
}
// details
$details = array();
// the author
if (isset($context['with_author_information']) && $context['with_author_information'] == 'Y') {
if ($item['create_name'] != $item['edit_name']) {
$details[] = sprintf(i18n::s('by %s, %s'), $item['create_name'], $item['edit_name']);
} else {
$details[] = sprintf(i18n::s('by %s'), $item['create_name']);
}
}
// the last action
$details[] = Anchors::get_action_label($item['edit_action']) . ' ' . Skin::build_date($item['edit_date']);
// the number of hits
if (Surfer::is_logged() && $item['hits'] > 1) {
$details[] = Skin::build_number($item['hits'], i18n::s('hits'));
}
// combine in-line details
if (count($details)) {
$suffix .= ucfirst(trim(implode(', ', $details)));
}
// end of details
$suffix .= '</span>';
// strip empty details
$suffix = str_replace(BR . '<span class="details"></span>', '', $suffix);
$suffix = str_replace('<span class="details"></span>', '', $suffix);
// the icon to put in the left column
if ($item['thumbnail_url']) {
$icon = $item['thumbnail_url'];
}
// commands
$commands = array(Skin::build_link(Sections::get_url($item['id'], 'edit'), i18n::s('edit'), 'basic'), Skin::build_link(Sections::get_url($item['id'], 'delete'), i18n::s('delete'), 'basic'));
// link to this page
$cells[] = $prefix . Skin::build_link($url, $title, 'section') . ' - ' . Skin::finalize_list($commands, 'menu') . $suffix;
// ranking
$cells[] = '<input type="text" size="5" name="section_rank_' . $item['id'] . '" value="' . $item['rank'] . '" onfocus="$(\'#section_selector_' . $count . '\').attr(\'checked\', \'checked\');" onchange="$(\'#act_on_sections\').prop(\'selectedIndex\', 6);" />';
// append the row
$text .= Skin::table_row($cells, $count++);
}
// select all rows
$cells = array('<input type="checkbox" class="row_selector" onclick="cascade_selection_to_all_section_rows(this);" />', i18n::s('Select all/none'), '');
$text .= Skin::table_row($cells, $count++);
// table suffix
$text .= Skin::table_suffix();
// end of processing
SQL::free($result);
return $text;
}
示例7: get_url
/**
* get the url to display the main page for this anchor
*
* @see shared/anchor.php
*
* @param string the targeted action ('view', 'print', 'edit', 'delete', ...)
* @return an anchor to the viewing script
*/
function get_url($action = 'view')
{
// sanity check
if (!isset($this->item['id'])) {
return NULL;
}
switch ($action) {
// view comments
case 'comments':
if ($this->has_option('view_as_tabs', FALSE)) {
return $this->get_url() . '#_discussion';
}
return Sections::get_url($this->item['id'], 'view', $this->item['title'], $this->item['nick_name']) . '#comments';
// list of files
// list of files
case 'files':
return $this->get_url() . '#_attachments';
// list of links
// list of links
case 'links':
return $this->get_url() . '#_attachments';
// another action
// another action
default:
return Sections::get_url($this->item['id'], $action, $this->item['title'], $this->item['nick_name']);
}
}
示例8: render
/**
* list dates at some anchor
*
* @param string type of replaced items (e.g., 'articles')
* @param string the anchor to consider (e.g., 'section:123')
* @param int page index
* @return string to be inserted in resulting web page, or NULL
*/
function render($type, $anchor, $page = 1)
{
global $context;
// instead of articles
if ($type != 'articles') {
return NULL;
}
// get the containing page
$container = Anchors::get($anchor);
// handle dates
include_once $context['path_to_root'] . 'dates/dates.php';
// the maximum number of articles per page
if (!defined('DATES_PER_PAGE')) {
define('DATES_PER_PAGE', 50);
}
// where we are
$offset = ($page - 1) * DATES_PER_PAGE;
// should we display all dates, or not?
$with_past_dates = FALSE;
if (preg_match('/\\bwith_past_dates\\b/i', $this->attributes['overlay_parameters'])) {
$with_past_dates = TRUE;
}
// menu to be displayed at the top
$menu = array();
// empowered users can contribute
if (Articles::allow_creation(NULL, $container)) {
Skin::define_img('ARTICLES_ADD_IMG', 'articles/add.gif');
$menu[] = '<div style="display: inline">' . Skin::build_link('articles/edit.php?anchor=' . urlencode($anchor), ARTICLES_ADD_IMG . i18n::s('Add an event'), 'span') . '</div>';
}
// ensure access to past dates
if (!$with_past_dates && ($items = Dates::list_past_for_anchor($anchor, $offset, DATES_PER_PAGE, 'compact'))) {
// turn an array to a string
if (is_array($items)) {
$items =& Skin::build_list($items, 'compact');
}
// navigation bar
$bar = array();
// count the number of dates in this section
$stats = Dates::stat_past_for_anchor($anchor);
if ($stats['count'] > DATES_PER_PAGE) {
$bar = array_merge($bar, array('_count' => sprintf(i18n::ns('%d date', '%d dates', $stats['count']), $stats['count'])));
}
// navigation commands for dates
if ($section = Sections::get(str_replace('section:', '', $anchor))) {
$home = Sections::get_permalink($section);
$prefix = Sections::get_url($section['id'], 'navigate', 'articles');
$bar = array_merge($bar, Skin::navigate($home, $prefix, $stats['count'], DATES_PER_PAGE, $page));
}
// display the bar
if (is_array($bar)) {
$items = Skin::build_list($bar, 'menu_bar') . $items;
}
// in a separate box
$menu[] = Skin::build_sliding_box(i18n::s('Past dates'), $items, 'past_dates', TRUE);
}
// menu displayed towards the top of the page
$text = Skin::finalize_list($menu, 'menu_bar');
// build a list of events
if (preg_match('/\\blayout_as_list\\b/i', $this->attributes['overlay_parameters'])) {
// list all dates
if ($with_past_dates) {
// navigation bar
$bar = array();
// count the number of dates in this section
$stats = Dates::stat_for_anchor($anchor);
if ($stats['count'] > DATES_PER_PAGE) {
$bar = array_merge($bar, array('_count' => sprintf(i18n::ns('%d date', '%d dates', $stats['count']), $stats['count'])));
}
// navigation commands for dates
$section = Sections::get($anchor);
$home = Sections::get_permalink($section);
$prefix = Sections::get_url($section['id'], 'navigate', 'articles');
$bar = array_merge($bar, Skin::navigate($home, $prefix, $stats['count'], DATES_PER_PAGE, $page));
// display the bar
if (count($bar)) {
$text .= Skin::build_list($bar, 'menu_bar');
}
// list one page of dates
if ($items = Dates::list_for_anchor($anchor, $offset, DATES_PER_PAGE, 'family')) {
$text .= $items;
}
// display only future dates to regular surfers
} else {
// show future dates on first page
if ($page == 1 && ($items = Dates::list_future_for_anchor($anchor, 0, 500, 'family', TRUE))) {
$text .= $items;
}
}
// deliver a calendar view for current month, plus months around
} else {
// show past dates as well
if ($with_past_dates) {
//.........这里部分代码省略.........
示例9:
} else {
Skin::define_img('SECTIONS_UNLOCK_IMG', 'sections/unlock.gif');
$context['page_tools'][] = Skin::build_link(Sections::get_url($item['id'], 'lock'), SECTIONS_UNLOCK_IMG . i18n::s('Unlock'), 'basic');
}
// delete the page
if ($cur_section->allows('deletion')) {
Skin::define_img('SECTIONS_DELETE_IMG', 'sections/delete.gif');
if (!is_object($overlay) || !($label = $overlay->get_label('delete_command', 'sections'))) {
$label = i18n::s('Delete this section');
}
$context['page_tools'][] = Skin::build_link(Sections::get_url($item['id'], 'delete'), SECTIONS_DELETE_IMG . $label, 'basic');
}
// manage content
if ($has_content) {
Skin::define_img('SECTIONS_MANAGE_IMG', 'sections/manage.gif');
$context['page_tools'][] = Skin::build_link(Sections::get_url($item['id'], 'manage'), SECTIONS_MANAGE_IMG . i18n::s('Manage content'), 'basic', i18n::s('Bulk operations'));
}
// duplicate command provided to container owners
if (Sections::is_owned(NULL, $anchor) || Surfer::is_associate()) {
Skin::define_img('SECTIONS_DUPLICATE_IMG', 'sections/duplicate.gif');
$context['page_tools'][] = Skin::build_link(Sections::get_url($item['id'], 'duplicate'), SECTIONS_DUPLICATE_IMG . i18n::s('Duplicate this section'));
}
}
// commands for associates
if (Surfer::is_associate()) {
Skin::define_img('SECTIONS_DUPLICATE_IMG', 'sections/duplicate.gif');
$context['page_tools'][] = Skin::build_link(Sections::get_url($item['id'], 'export'), SECTIONS_DUPLICATE_IMG . i18n::s('Export this section'));
}
}
// render the skin
render_skin();
示例10: array
// options tab
//
$text = '';
// provide information to section owner, and to editors of parent section
if (Sections::is_owned($item, $anchor) || Surfer::is_associate()) {
// owner
if (isset($item['owner_id'])) {
$label = i18n::s('Owner');
if ($owner = Users::get($item['owner_id'])) {
$input = Users::get_link($owner['full_name'], $owner['email'], $owner['id']);
} else {
$input = i18n::s('No owner has been found.');
}
// only real owner can delegate to another person
if (Sections::is_owned($item, $anchor, TRUE) || Surfer::is_associate()) {
$input .= ' <span class="details">' . Skin::build_link(Sections::get_url($item['id'], 'own'), i18n::s('Change'), 'button') . '</span>';
}
$fields[] = array($label, $input);
}
}
// the active flag: Yes/public, Restricted/logged, No/associates --we don't care about inheritance, to enable security changes afterwards
$label = i18n::s('Access');
$input = Skin::build_active_set_input($item);
$hint = Skin::build_active_set_hint($anchor);
$fields[] = array($label, $input, $hint);
// locked: Yes / No
$label = i18n::s('Locker');
$input = '<input type="radio" name="locked" value="N"';
if (!isset($item['locked']) || $item['locked'] != 'Y') {
$input .= ' checked="checked"';
}
示例11: sprintf
// page title
if (isset($item['title'])) {
$context['page_title'] = sprintf(i18n::s('Owner of %s'), $item['title']);
}
// stop crawlers
if (Surfer::is_crawler()) {
Safe::header('Status: 401 Unauthorized', TRUE, 401);
Logger::error(i18n::s('You are not allowed to perform this operation.'));
// not found
} elseif (!isset($item['id'])) {
include '../error.php';
// permission denied
} elseif (!$permitted) {
// anonymous users are invited to log in or to register
if (!Surfer::is_logged()) {
Safe::redirect($context['url_to_home'] . $context['url_to_root'] . 'users/login.php?url=' . urlencode(Sections::get_url($item['id'], 'own')));
}
// permission denied to authenticated user
Safe::header('Status: 401 Unauthorized', TRUE, 401);
Logger::error(i18n::s('You are not allowed to perform this operation.'));
// do the job
} elseif (!count($context['error'])) {
// look for the user through his nick name
if (isset($_REQUEST['assigned_name']) && ($user = Users::get($_REQUEST['assigned_name']))) {
$_REQUEST['anchor'] = 'user:' . $user['id'];
}
// transfer ownership
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'set' && isset($_REQUEST['anchor'])) {
// assign a user, and also update his watch list
$attributes = array('id' => $item['id'], 'owner_id' => $user['id']);
Sections::put_attributes($attributes);
示例12: array
// all commands
$menu = array();
$menu[] = $options;
// back to section
$menu[] = Skin::build_link(Sections::get_permalink($item), i18n::s('Cancel'), 'span');
// finalize the menu
$text .= Skin::finalize_list($menu, 'menu_bar');
// count the number of articles in this section
$menu = array();
if ($count = Sections::count_for_anchor('section:' . $item['id'])) {
if ($count > min(5, $items_per_page)) {
$menu = array_merge($menu, array('_count' => sprintf(i18n::ns('%d section', '%d sections', $count), $count)));
}
// navigation commands for sections
$home = Sections::get_url($item['id'], 'manage');
$prefix = Sections::get_url($item['id'], 'manage', 'sections');
$menu = array_merge($menu, Skin::navigate($home, $prefix, $count, $items_per_page, $zoom_index));
}
if (count($menu)) {
$text .= Skin::build_list($menu, 'menu_bar');
}
}
// display in a separate panel
if (trim($text)) {
$panels[] = array('sections', i18n::s('Sections'), 'sections_panel', $text);
}
// assemble all tabs
//
if (count($panels)) {
$context['text'] .= Skin::build_tabs($panels);
} else {
示例13: encode_field
// the title
$text .= ' <title>' . encode_field(strip_tags($context['channel_title'])) . "</title>\n";
// the body
$text .= '</head>' . "\n" . '<body>' . "\n";
// the main rss feed of this site
$text .= ' <outline type="rss" text="' . encode_field($context['channel_title']) . '" xmlUrl="' . $context['url_to_home'] . $context['url_to_root'] . Feeds::get_url('rss') . '"' . " />\n";
// full articles
$text .= ' <outline type="rss" text="' . encode_field(i18n::c('Pages with full content') . $suffix) . '" xmlUrl="' . $context['url_to_home'] . $context['url_to_root'] . Feeds::get_url('articles') . '"' . " />\n";
// newest comments
$text .= ' <outline type="rss" text="' . encode_field(i18n::c('Comments') . $suffix) . '" xmlUrl="' . $context['url_to_home'] . $context['url_to_root'] . Feeds::get_url('comments') . '"' . " />\n";
// the file rss feed for podcasting, etc.
$text .= ' <outline type="rss" text="' . encode_field(i18n::c('Files and podcasts') . $suffix) . '" xmlUrl="' . $context['url_to_home'] . $context['url_to_root'] . Feeds::get_url('files') . '"' . " />\n";
// one feed per section
if ($items = Sections::list_by_title_for_anchor(NULL, 0, COMPACT_LIST_SIZE, 'raw')) {
foreach ($items as $id => $attributes) {
$text .= ' <outline type="rss" text="' . encode_field(strip_tags($attributes['title']) . $suffix) . '" xmlUrl="' . $context['url_to_home'] . $context['url_to_root'] . Sections::get_url($id, 'feed') . '"' . " />\n";
}
}
// one feed per category
if ($items = Categories::list_by_date(0, COMPACT_LIST_SIZE, 'raw')) {
foreach ($items as $id => $attributes) {
$text .= ' <outline type="rss" text="' . encode_field(strip_tags($attributes['title']) . $suffix) . '" xmlUrl="' . $context['url_to_home'] . $context['url_to_root'] . Categories::get_url($id, 'feed') . '"' . " />\n";
}
}
// one feed per user
if ($items = Users::list_by_posts(0, COMPACT_LIST_SIZE, 'raw')) {
foreach ($items as $id => $attributes) {
$text .= ' <outline type="rss" text="' . encode_field(strip_tags($attributes['nick_name']) . $suffix) . '" xmlUrl="' . $context['url_to_home'] . $context['url_to_root'] . Users::get_url($id, 'feed') . '"' . " />\n";
}
}
// the postamble
示例14: layout
//.........这里部分代码省略.........
$this_section = new section();
$this_section->load_by_content($item, $anchor);
if ($this_section->is_assigned()) {
if ($order == 'publication' && ($items =& Articles::list_for_anchor_by('draft', 'section:' . $item['id'], 0, 20, 'compact'))) {
if (is_array($items)) {
$items = Skin::build_list($items, 'compact');
}
$box['top_bar'] += array('_draft' => Skin::build_sliding_box(i18n::s('Draft pages'), $items));
}
}
// top menu
if ($box['top_bar']) {
$box['text'] .= Skin::build_list($box['top_bar'], 'menu_bar');
}
// get pages
$items =& Articles::list_for_anchor_by($order, 'section:' . $item['id'], $offset, $items_per_page, $layout);
// items in the middle
if (is_array($items) && isset($item['articles_layout']) && $item['articles_layout'] == 'compact') {
$box['text'] .= Skin::build_list($items, 'compact');
} elseif (is_array($items)) {
$box['text'] .= Skin::build_list($items, 'decorated');
} elseif (is_string($items)) {
$box['text'] .= $items;
}
// no navigation bar with alistapart
if (!isset($item['articles_layout']) || $item['articles_layout'] != 'alistapart') {
// count the number of articles in this section
if ($count = Articles::count_for_anchor('section:' . $item['id'])) {
if ($count > 20) {
$box['bottom_bar'] += array('_count' => sprintf(i18n::ns('%d page', '%d pages', $count), $count));
}
// navigation commands for articles
$home = Sections::get_permalink($item);
$prefix = Sections::get_url($item['id'], 'navigate', 'articles');
$box['bottom_bar'] += Skin::navigate($home, $prefix, $count, $items_per_page, 1);
}
}
// bottom menu
if ($box['bottom_bar']) {
$box['text'] .= Skin::build_list($box['bottom_bar'], 'menu_bar');
}
// there is some box content
if ($box['text']) {
$text .= $box['text'];
}
}
// layout sub-sections
if (!isset($item['sections_layout']) || $item['sections_layout'] != 'none') {
// select a layout
if (!isset($item['sections_layout']) || !$item['sections_layout']) {
include_once 'layout_sections.php';
$layout = new Layout_sections();
} else {
$layout = Layouts::new_($item['sections_layout'], 'section');
}
// the maximum number of sections per page
if (is_object($layout)) {
$items_per_page = $layout->items_per_page();
} else {
$items_per_page = SECTIONS_PER_PAGE;
}
// build a complete box
$box = array('top_bar' => array(), 'text' => '', 'bottom_bar' => array());
// the command to add a new section
//if(Sections::allow_creation($item, $anchor)) {
if ($anchor->allows('creation', 'section')) {