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


PHP wiki_get_orphaned_pages函数代码示例

本文整理汇总了PHP中wiki_get_orphaned_pages函数的典型用法代码示例。如果您正苦于以下问题:PHP wiki_get_orphaned_pages函数的具体用法?PHP wiki_get_orphaned_pages怎么用?PHP wiki_get_orphaned_pages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: print_delete_content

    /**
     * Show wiki page delete options
     *
     * @param bool $showorphan
     */
    protected function print_delete_content($showorphan = true) {
        $contents = array();
        $table = new html_table();
        $table->head = array('', get_string('pagename','wiki'));
        $table->attributes['class'] = 'generaltable mdl-align';
        $swid = $this->subwiki->id;
        if ($showorphan) {
            if ($orphanedpages = wiki_get_orphaned_pages($swid)) {
                $this->add_page_delete_options($orphanedpages, $swid, $table);
            } else {
                $table->data[] = array('', get_string('noorphanedpages', 'wiki'));
            }
        } else {
            if ($pages = wiki_get_page_list($swid)) {
                $this->add_page_delete_options($pages, $swid, $table);
            } else {
                $table->data[] = array('', get_string('nopages', 'wiki'));
            }
        }

        ///Print the form
        echo html_writer::start_tag('form', array(
                                                'action' => new moodle_url('/mod/wiki/admin.php'),
                                                'method' => 'post'));
        echo html_writer::tag('div', html_writer::empty_tag('input', array(
                                                                         'type'  => 'hidden',
                                                                         'name'  => 'pageid',
                                                                         'value' => $this->page->id)));

        echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'option', 'value' => $this->view));
        echo html_writer::table($table);
        echo html_writer::start_tag('div', array('class' => 'mdl-align'));
        if (!$showorphan) {
            echo html_writer::empty_tag('input', array(
                                                     'type'    => 'submit',
                                                     'class'   => 'wiki_form-button',
                                                     'value'   => get_string('listorphan', 'wiki'),
                                                     'sesskey' => sesskey()));
        } else {
            echo html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'listall', 'value'=>'1'));
            echo html_writer::empty_tag('input', array(
                                                     'type'    => 'submit',
                                                     'class'   => 'wiki_form-button',
                                                     'value'   => get_string('listall', 'wiki'),
                                                     'sesskey' => sesskey()));
        }
        echo html_writer::end_tag('div');
        echo html_writer::end_tag('form');
    }
开发者ID:Burick,项目名称:moodle,代码行数:54,代码来源:pagelib.php

示例2: print_orphaned_content

 /**
  * Prints the orphaned tab content
  *
  *
  */
 private function print_orphaned_content()
 {
     global $OUTPUT;
     $page = $this->page;
     if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) {
         $fresh = wiki_refresh_cachedcontent($page);
         $page = $fresh['page'];
     }
     $swid = $this->subwiki->id;
     $table = new html_table();
     $table->head = array(get_string('orphaned', 'wiki') . $OUTPUT->help_icon('orphaned', 'wiki'));
     $table->attributes['class'] = 'wiki_editor generalbox';
     $table->data = array();
     $table->rowclasses = array();
     if ($orphanedpages = wiki_get_orphaned_pages($swid)) {
         foreach ($orphanedpages as $page) {
             $link = wiki_parser_link($page->title, array('swid' => $swid));
             $class = $link['new'] ? 'class="wiki_newentry"' : '';
             $table->data[] = array('<a href="' . $link['url'] . '"' . $class . '>' . format_string($link['content']) . '</a>');
         }
     } else {
         $table->data[] = array(get_string('noorphanedpages', 'wiki'));
     }
     echo html_writer::table($table);
 }
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:30,代码来源:pagelib.php


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