From 5b0bc60858d32ed5eaae541cc4ca09d9fccd6063 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 17 Aug 2004 16:12:14 +0000 Subject: [PATCH] The little edit icon was becoming very annoying :-) How about these tabs? --- lang/en/wiki.php | 8 +++++- mod/wiki/view.php | 63 +++++++++++++++++++++++------------------------ 2 files changed, 38 insertions(+), 33 deletions(-) diff --git a/lang/en/wiki.php b/lang/en/wiki.php index 566824f197..004457b571 100644 --- a/lang/en/wiki.php +++ b/lang/en/wiki.php @@ -193,4 +193,10 @@ $string['moduledirectory']='Module Directory'; $string['exportto']='Export to'; $string['exportsuccessful']='Export successful.'; $string['index']='Index'; -?> \ No newline at end of file + +$string['tabedit']='Edit'; +$string['tabview']='View'; +$string['tabinfo']='Info'; +$string['tablinks']='Links'; +$string['tabattachments']='Attachments'; +?> diff --git a/mod/wiki/view.php b/mod/wiki/view.php index ba95ea78a2..eeba07a07e 100644 --- a/mod/wiki/view.php +++ b/mod/wiki/view.php @@ -262,34 +262,8 @@ echo ''; echo ''; - echo ''; - echo ''; - /// Searchform - echo ''; @@ -315,14 +289,38 @@ } if($ewiki_title==$wiki_entry->pagename && !empty($wiki->summary)) { - print "
"; - print_simple_box(format_text($wiki->summary, FORMAT_MOODLE), "center"); - print "
"; + if (trim(strip_tags($wiki->summary))) { + print "
"; + print_simple_box(format_text($wiki->summary, FORMAT_MOODLE), "center"); + print "
"; + } } - // The wiki Contents - print_simple_box_start( "center", "100%", "$THEME->cellcontent", "20"); + + if ($canedit) { /// Print tabs with commands for this page + $tabstyle = ' style="padding-left: 5px;padding-right: 5px" '; + + echo "
'; - if ($canedit) { - $iconstr=""; - $editicon= ''.get_string('; - $infoicon= ''.get_string('; - - if($ewiki_action!="edit" && !in_array($wikipage, $specialpages)) { - $iconstr.=''.$editicon.""; - } - else { - $iconstr.=$editicon; - } - - if($ewiki_action!="info" && !in_array($wikipage, $specialpages)) { - $iconstr.=''.$infoicon.""; - } - else { - $iconstr.=$infoicon; - } - echo $iconstr; - } - echo ''; - wiki_print_page_actions($cm->id, $specialpages, $ewiki_id, $ewiki_action, $wiki->ewikiacceptbinary, $canedit); - echo ''; + echo ''; wiki_print_search_form($cm->id, $q, $userid, $groupid, false); echo '
"; + echo ""; + $tabs = array('view', 'edit','links','info'); + if ($binary) { + $tabs[] = 'attachments'; + } + foreach ($tabs as $tab) { + $tabname = get_string("tab$tab", 'wiki'); + if ($ewiki_action != "$tab" && !in_array($wikipage, $specialpages)) { + echo ''; + } else { + echo ''; + } + } + echo ""; + echo "
'; + echo ''.$tabname.''; + echo ''.$tabname.'
"; + } + print_simple_box_start( "right", "100%", "$THEME->cellcontent", "20"); if($ewiki_action=="edit") { # When editing, the filters shall not interfere the wiki-source print $content; @@ -330,6 +328,7 @@ print(format_text($content, $moodle_format)); } print_simple_box_end(); + echo "
"; /// Finish the page print_footer($course); -- 2.39.5