本文整理汇总了PHP中wiki_parser_link函数的典型用法代码示例。如果您正苦于以下问题:PHP wiki_parser_link函数的具体用法?PHP wiki_parser_link怎么用?PHP wiki_parser_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wiki_parser_link函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_page_delete_options
/**
* helper function for print_delete_content. This will add data to the table.
*
* @global object $OUTPUT
* @param array $pages objects of wiki pages in subwiki
* @param int $swid id of subwiki
* @param object $table reference to the table in which data needs to be added
*/
protected function add_page_delete_options($pages, $swid, &$table) {
global $OUTPUT;
foreach ($pages as $page) {
$link = wiki_parser_link($page->title, array('swid' => $swid));
$class = ($link['new']) ? 'class="wiki_newentry"' : '';
$pagelink = '<a href="' . $link['url'] . '"' . $class . '>' . format_string($link['content']) . '</a>';
$urledit = new moodle_url('/mod/wiki/edit.php', array('pageid' => $page->id, 'sesskey' => sesskey()));
$urldelete = new moodle_url('/mod/wiki/admin.php', array(
'pageid' => $this->page->id,
'delete' => $page->id,
'option' => $this->view,
'listall' => !$this->listorphan?'1': '',
'sesskey' => sesskey()));
$editlinks = $OUTPUT->action_icon($urledit, new pix_icon('t/edit', get_string('edit')));
$editlinks .= $OUTPUT->action_icon($urldelete, new pix_icon('t/delete', get_string('delete')));
$table->data[] = array($editlinks, $pagelink);
}
}
示例2: wiki_build_tree
/**
* Generate wiki's page tree
*
* @param page_wiki $page. A wiki page object
* @param navigation_node $node. Starting navigation_node
* @param array $keys. An array to store keys
* @return an array with all tree nodes
*/
function wiki_build_tree($page, $node, &$keys)
{
$content = array();
static $icon;
$icon = new pix_icon('f/odt', '');
$pages = wiki_get_linked_pages($page->id);
foreach ($pages as $p) {
$key = $page->id . ':' . $p->id;
if (in_array($key, $keys)) {
break;
}
array_push($keys, $key);
$l = wiki_parser_link($p);
$link = new moodle_url('/mod/wiki/view.php', array('pageid' => $p->id));
// navigation_node::get_content will format the title for us
$nodeaux = $node->add($p->title, $link, null, null, null, $icon);
if ($l['new']) {
$nodeaux->add_class('wiki_newentry');
}
wiki_build_tree($p, $nodeaux, $keys);
}
$content[] = $node;
return $content;
}
示例3: print_updated_content
/**
* Prints the updated tab content
*
* @uses $COURSE, $OUTPUT
*
*/
private function print_updated_content()
{
global $COURSE, $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('updatedpages', 'wiki') . $OUTPUT->help_icon('updatedpages', 'wiki'));
$table->attributes['class'] = 'wiki_editor generalbox';
$table->data = array();
$table->rowclasses = array();
if ($pages = wiki_get_updated_pages_by_subwiki($swid)) {
$strdataux = '';
foreach ($pages as $page) {
$user = wiki_get_user_info($page->userid);
$strdata = strftime('%d %b %Y', $page->timemodified);
if ($strdata != $strdataux) {
$table->data[] = array($OUTPUT->heading($strdata, 4));
$strdataux = $strdata;
}
$link = wiki_parser_link($page->title, array('swid' => $swid));
$class = $link['new'] ? 'class="wiki_newentry"' : '';
$linkpage = '<a href="' . $link['url'] . '"' . $class . '>' . format_string($link['content']) . '</a>';
$icon = $OUTPUT->user_picture($user, array($COURSE->id));
$table->data[] = array("{$icon} {$linkpage}");
}
} else {
$table->data[] = array(get_string('noupdatedpages', 'wiki'));
}
echo html_writer::table($table);
}