11<?php
22/**
3- * @file SimpleWiki.template .php
3+ * @file SimpleWiki-Subs .php
44 * @author James Robson
55 *
6- * Copyright (c) 2012 , James Robson
6+ * Copyright (c) 2013 , James Robson
77 * All rights reserved.
88 *
99 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
2323 * @todo Allow drag and drop extending of SimpleWiki
2424*/
2525
26- function template_main ()
26+ /* function template_main()
2727{
28- global $ context , $ user_info , $ txt ;
28+ //call_user_func('template_wiki_' . $context['wiki_theme']);
29+ }*/
30+
31+ function template_wiki_above ()
32+ {
33+ global $ user_info , $ txt ;
2934 echo '<div class="title_bar">
30- <h3 class="titlebg">
35+ <h3 class="titlebg">
3136 <div id="quick_search" class="align_right"><form action="index.php?action=wiki;sa=search" method="post">
32- <input class="input_text" type="text" name="q" value=" '. $ txt ['search ' ]. '" /></form></div> ' .$ txt ['wiki ' ]. '</h3>
37+ <input class="input_text" type="text" name="q" value=" ', $ txt ['search ' ], '" /></form></div> ' .$ txt ['wiki ' ], '</h3>
3338 </div><span class="upperframe"><span></span></span>
34- <div class="roundframe"> '. sprintf ($ txt ['wiki_welcome ' ], ($ user_info ['name ' ]? $ user_info ['name ' ]: $ txt ['guest ' ])). '
39+ <div class="roundframe"> ', sprintf ($ txt ['wiki_welcome ' ], ($ user_info ['name ' ] ? $ user_info ['name ' ] : $ txt ['guest ' ])), '
3540 </div><span class="lowerframe"><span></span></span> ' ;
3641 echo '<br /><div id="left_admsection"> ' ;
3742 // @todo Wiki Menu
3843 echo '</div> ' ;
3944 echo '<div class="windowbg2" id="main_admsection"><span class="topslice"><span></span></span><div class="content"> ' ;
40- call_user_func ('template_wiki_ ' . $ context ['wiki_theme ' ]);
41- echo '</div><span class="botslice clear"><span></span></span></div><br class="clear" /> ' ;
45+ }
46+
47+ function template_wiki_below ()
48+ {
49+ echo '</div><span class="botslice clear"><span></span></span></div><br class="clear" /> ' ;
4250 template_wiki_copyright ();
4351}
4452
4553function template_wiki_namespace_view ()
4654{
47- global $ context , $ txt ;
55+ global $ context , $ txt ;
4856 $ tools = array (
4957 'edit ' => array ('name ' =>'wiki_edit ' , 'show ' =>wikiAllowedTo ('edit ' ), 'url ' =>wiki_link ('edit:page_string ' ), 'image ' => 'wiki_edit.png ' ),
5058 'history ' => array ('name ' =>'wiki_history ' , 'show ' =>wikiAllowedTo ('view_history ' ), 'url ' =>wiki_link ('history:page_string ' ), 'image ' => 'wiki_history.png ' ),
5159 'protect ' => array ('name ' =>'wiki_protect_page ' , 'show ' =>wikiAllowedTo ('protect ' ), 'url ' =>wiki_link ('protect:page_string ' ), 'image ' => 'wiki_lock.png ' ),
5260 'create ' => array ('name ' =>'wiki_create_new_page ' , 'show ' =>wikiAllowedTo ('create ' ), 'url ' =>wiki_link ('create:WikiSpecial ' ), 'image ' => 'wiki_create.png ' ),
5361 );
5462
55- /*$toolbar = */ template_wiki_make_toolbar ($ tools );
56- #echo $toolbar;
57- //if(function_exists('template_wiki_namespace_'.$context['name_space']))
58- // call_user_func('template_wiki_namespace_'.$context['name_space']);
59- echo $ context ['wiki ' ]['page_data ' ]['body ' ];
63+ template_wiki_make_toolbar ($ tools );
64+ echo parse_bbc ($ context ['wiki ' ]['page_data ' ]['body ' ]);
6065}
6166
6267// @todo clean
@@ -72,7 +77,6 @@ function template_wiki_edit_box($action, $titlebox = false)
7277{
7378 global $ txt , $ context ;
7479 echo '<form action=" ' , $ action , '" method="post"> ' ;
75- // @todo Use proper page name... (i.e. realname)
7680 if ($ titlebox )
7781 echo '<h2> ' , $ txt ['title ' ], ':</h2><input type="text" value= \'' , htmlspecialchars ($ context ['wiki ' ]['page_data ' ]['realname ' ]), '\' name="p" /> ' ;
7882 else
@@ -96,5 +100,5 @@ function template_wiki_make_toolbar($tools)
96100
97101function template_wiki_copyright ()
98102{
99- echo '<div class="centertext smalltext"><a href="http://simplewiki.co.uk">SimpleWiki © 2010-2012 , James Robson</a></div> ' ;
103+ echo '<div class="centertext smalltext"><a href="http://simplewiki.co.uk">SimpleWiki © 2010-2013 , James Robson</a></div> ' ;
100104}
0 commit comments