Ejemplo n.º 1
0
Archivo: view.php Proyecto: rair/yacs
     $lines[] = Skin::build_link($context['url_to_home'] . $context['url_to_root'] . Files::get_url('article:' . $item['id'], 'feed'), i18n::s('Recent files'), 'xml');
     // comments are allowed
     if ($cur_article->allows('creation', 'comment')) {
         $lines[] = Skin::build_link($context['url_to_home'] . $context['url_to_root'] . Comments::get_url('article:' . $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 =& Articles::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 (!$cur_article->has_option('no_contextual_menu') && isset($context['current_focus']) && ($menu =& Skin::build_contextual_menu($context['current_focus']))) {
     // use title from topmost level
     if (count($context['current_focus']) && ($top_anchor = Anchors::get($context['current_focus'][0]))) {
         $box_title = $top_anchor->get_title();
         $box_url = $top_anchor->get_url();
         // generic title
Ejemplo n.º 2
0
Archivo: go.php Proyecto: rair/yacs
    // 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
    if (count($items) == 1) {
        list($url, $attributes) = each($items);
        Safe::redirect($url);
    }
    // splash
    $context['text'] .= '<p>' . i18n::s('Select below among available pages.') . '</p>';
    // several pages
    $context['text'] .= Skin::build_list($items, 'decorated');
    // look in user profiles
} elseif ($item = Users::get($id)) {
    Safe::redirect(Users::get_permalink($item));
    // not found
} else {
    $context['text'] .= '<p>' . sprintf(i18n::s('Sorry, no page has the provided name: %s'), $id) . '</p>' . "\n";