Skip to content

Commit

Permalink
Linking wiki pages to other moodle stuff by tag, and remove an unused…
Browse files Browse the repository at this point in the history
… function in wiki
  • Loading branch information
Dongsheng Cai authored and stronk7 committed Dec 20, 2010
1 parent ccdd159 commit 7b8b366
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
10 changes: 9 additions & 1 deletion mod/wiki/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,15 @@ function wiki_print_page_content($page, $context, $subwikiid) {

if (!empty($CFG->usetags)) {
$tags = tag_get_tags_array('wiki_pages', $page->id);
echo '<p class="wiki-tags"><span>Tags: </span>' . join($tags, ", ") . '</p>';
echo $OUTPUT->container_start('wiki-tags');
echo '<span>'.get_string('tags').': </span>';
$links = array();
foreach ($tags as $tagid=>$tag) {
$url = new moodle_url('/tag/index.php', array('tag'=>$tag));
$links[] = html_writer::link($url, $tag);
}
echo join($links, ", ");
echo $OUTPUT->container_end();
}

wiki_increment_pageviews($page);
Expand Down
18 changes: 0 additions & 18 deletions mod/wiki/pagelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1463,24 +1463,6 @@ function set_view($option) {
$this->view = $option;
}

function print_menu_map() {
$options = array('contributions', 'links', 'orphaned', 'pageindex', 'pagelist', 'updatedpages');
$items = array();
foreach ($options as $opt) {
$items[] = get_string($opt, 'wiki');
}
$table = new html_table();
$table->head = array(get_string('mapmenu', 'wiki'));
$table->attributes['class'] = 'wiki_editor generalbox';
$table->data = array();
$table->rowclasses = array();
foreach ($items as $key => $item) {
$link = new moodle_url('/mod/wiki/map.php', array('pageid' => $this->page->id, 'option' => $key + 1));
$table->data[] = array(html_writer::link($link, $item));
}
echo html_writer::table($table);
}

function set_url() {
global $PAGE, $CFG;
$PAGE->set_url($CFG->wwwroot . '/mod/wiki/map.php', array('pageid' => $this->page->id));
Expand Down

0 comments on commit 7b8b366

Please sign in to comment.