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


PHP Sections::list_inactive_by_title_for_anchor方法代码示例

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


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

示例1: array

             $box['bottom_bar'] += Skin::navigate($home, $prefix, $count, $items_per_page, $zoom_index);
         }
         // 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'];
         }
     }
 }
 // associates may list special sections as well
 if (!$zoom_type && Surfer::is_empowered()) {
     // inactive sections, if any
     $items = Sections::list_inactive_by_title_for_anchor('section:' . $item['id'], 0, 50, 'compact');
     // we have an array to format
     if (count($items)) {
         $items =& Skin::build_list($items, 'compact');
     }
     // displayed as another box
     if ($items) {
         $context['page_menu'] += array('_other_sections' => Skin::build_sliding_box(i18n::s('Other sections'), $items, NULL, TRUE, TRUE));
     }
 }
 // trailer information
 //
 // add trailer information from the overlay, if any
 if (is_object($overlay)) {
     $text .= $overlay->get_text('trailer', $item);
 }
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:view_as_tabs.php

示例2: array_merge

            $menu = array_merge($menu, Skin::navigate($home, $prefix, $count, $items_per_page, $page));
            // add a menu at the bottom
            $text .= Skin::build_list($menu, 'menu_bar');
        }
        // make a box
        if ($items) {
            $text .= Skin::build_box('', $items, 'header1', 'sections');
        }
        // associates may list specific sections as well
        if ($page == 1 && Surfer::is_associate()) {
            // load the layout to use
            $layout = Layouts::new_('yahoo', 'section');
            $layout->set_variant(20);
            // show more elements at the site map
            // query the database and layout that stuff
            if ($items = Sections::list_inactive_by_title_for_anchor(NULL, 0, 50, $layout)) {
                // we have an array to format
                if (is_array($items)) {
                    $items = Skin::build_list($items, '2-columns');
                }
                // displayed as another page section
                $text .= Skin::build_box(i18n::s('Other sections'), $items, 'header1', 'other_sections');
            }
        }
        // cache this to speed subsequent queries
        Cache::put($cache_id, $text, 'sections');
    }
    $context['text'] .= $text;
}
// the suffix hook for the site map page
if (is_callable(array('Hooks', 'include_scripts'))) {
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:index.php

示例3: get_options_for_anchor

 /**
  * get options recursively
  *
  * This function is called internally by Sections::get_options(), above.
  *
  * @param string the current anchor to an existing section (e.g., 'section:12')
  * @param string spaces to prepend before section name -- to reflect depth
  * @param string the reference of the default section
  * @param array list of sections made of $id => $attributes
  * @return the HTML to insert in the page
  *
  */
 public static function get_options_for_anchor($anchor, $spaces, $default, $to_avoid)
 {
     global $context;
     // add to text
     $text = '';
     // list sections at this level
     if ($sections = Sections::list_by_title_for_anchor($anchor, 0, 1000, 'raw')) {
         foreach ($sections as $id => $attributes) {
             if (Sections::match($id, $to_avoid)) {
                 continue;
             }
             // this section
             $reference = 'section:' . $id;
             $text .= '<option value="' . $reference . '"';
             // the section is locked
             if (isset($attributes['locked']) && $attributes['locked'] == 'Y' && !Surfer::is_associate()) {
                 $text .= ' style="font-style: italic;" disabled="disabled"';
             }
             // currently selected
             if ($default && $default == $reference) {
                 $text .= ' selected="selected"';
             }
             $text .= '>' . $spaces . Skin::strip($attributes['title']) . "</option>\n";
             // depending sections, if any
             if ($to_avoid == 'no_subsections') {
             } elseif ($depending = Sections::get_options_for_anchor($reference, $spaces . '&nbsp;&nbsp;', $default, $to_avoid)) {
                 $text .= $depending;
             }
         }
     }
     // associates can also access inactive sections at this level
     if ($anchor && Surfer::is_associate()) {
         if ($sections = Sections::list_inactive_by_title_for_anchor($anchor, 0, 100, 'raw')) {
             foreach ($sections as $id => $attributes) {
                 if (Sections::match($id, $to_avoid)) {
                     continue;
                 }
                 // this section
                 $reference = 'section:' . $id;
                 $text .= '<option value="' . $reference . '"';
                 if ($default && $default == $reference) {
                     $text .= ' selected="selected"';
                 }
                 $text .= '>' . $spaces . Skin::strip($attributes['title']) . "</option>\n";
                 // depending sections, if any
                 if ($depending = Sections::get_options_for_anchor($reference, $spaces . '&nbsp;&nbsp;', $default, $to_avoid)) {
                     $text .= $depending;
                 }
             }
         }
     }
     // end of job
     return $text;
 }
开发者ID:rair,项目名称:yacs,代码行数:66,代码来源:sections.php


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