1
2 <?php
3 /**
4   * Print the search form
5  *
6   * @author Andreas Gohr <andi@splitbrain.org>
7   * modified to enable image icon for search form @author Paul Minifie
8   */
9  function tpl_searchform_mod(){
10    global $lang;
11    global $ACT;
12    print '<span class="controlform">';
13    print '<form action="'.wl().'" accept-charset="utf-8" class="search" name="search" onsubmit="return svchk()">';
14    print '<input type="hidden" name="do" value="search" />';
15    print '<input type="text" size="15"';
16    if ($ACT == 'search')
17      print 'value="'.$_REQUEST['id'].'" '; /* keep search input as long as user stays on search page */
18    print 'id="qsearch_in" accesskey="f" name="id" class="text_input" onkeyup="ajax_qsearch.call(\'qsearch_in\',\'qsearch_out\')" />';
19    //changed to make class = "searchbutton"
20    print '<input type="submit" value="'.$lang['btn_search'].'" class="searchbutton" />';
21    //following line changed to enabled image button icon
22    //print '<input type="image" src='.$lang['btn_search_img'].' title="'.$lang['btn_search'].'" class="searchbutton" />';
23    //end mod
24    print '<div id="qsearch_out" class="ajax_qsearch" onclick="this.style.display=\'none\'"></div>';
25    print '</form>';
26    print '</span>';
27  }
28
29
30
31
32 /**
33   * Print the addpage form
34   *
35   * @author Paul Minifie
36   */
37  function tpl_addpage(){
38    global $lang;
39    global $ACT;
40    global $ID;
41    global $INFO;
42    global $conf;
43    if(($ACT == 'show' || $ACT == 'search')&&$INFO['writable']&&$conf['amanuensis']['addpagemod']=='true'&&$conf['amanuensis']['addpage']=='true'){
44    print '<span class="controlform">';
45    print 'new:  ' ;
46    print '<form action="'.wl().'" accept-charset="utf-8" class="search" name="search" onsubmit="return svchk()">';
47    print '<input type="hidden" name="do" value="addpage" />';
48    print '<input type="hidden" name="id" value="'.$ID.'"/>';
49    //print '<input type="hidden" name="id" value="' . idfilter($ID) . '"/>';
50    print '<input type="text" name="newpagename" size="15" class="text_input"/> ';
51    print '<input type="submit" value="'.$lang['btn_addpage'].'" title="'.$lang['btn_addpage'].'"  class="searchbutton" name="addpage" value="page" /> ';
52    print '<input type="submit" value="'.$lang['btn_addsubpage'].'" title="'.$lang['btn_addsubpage'].'" class="searchbutton" name="addpage" value="subpage"  /> ';
53    //print '<input type="image" src='.$lang['btn_search_img'].' title="'.$lang['btn_addpage'].'" class="addpagebutton" name="addpage" value="page" /> ';
54    //print '<input type="image" src='.$lang['btn_search_img'].' title="'.$lang['btn_addsubpage'].'" class="addsubpagebutton" name="addsubpage" value="subpage"  /> ';
55    print '</form>';
56        print '</span>';
57    }
58  }
59
60  /**
61 * Like the action buttons but links
62 *
63 * Available links are
64 *
65 *  edit    - edit/create/show button
66 *  history - old revisions
67 *  recent  - recent changes
68 *  login   - login/logout button - if ACL enabled
69 *  index   - The index
70 *  admin   - admin page - if enough rights
71 *  top     - a back to top button
72 *  back    - a back to parent button - if available
73
74 *  profile -adds a link to the password mod page
75 *  help    -adds a link to the help page button
76 *  about   -adds a link to the about button
77 *
78 * @author Andreas Gohr <andi@splitbrain.org>
79 * @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
80 * @see    tpl_button
81 */
82function tpl_actionlink_mod($type,$pre='',$suf=''){
83  global $ID;
84  global $INFO;
85  global $REV;
86  global $ACT;
87  global $conf;
88  global $lang;
89
90  switch($type){
91    case 'edit':
92      #most complicated type - we need to decide on current action
93      if($ACT == 'show' || $ACT == 'search'){
94        if($INFO['writable']){
95          if($INFO['exists']){
96            tpl_link(wl($ID,'do=edit&amp;rev='.$REV),
97                     $pre.$lang['btn_edit'].$suf,
98                     'class="action" accesskey="e" rel="nofollow"');
99          }else{
100            tpl_link(wl($ID,'do=edit&amp;rev='.$REV),
101                     $pre.$lang['btn_create'].$suf,
102                     'class="action" accesskey="e" rel="nofollow"');
103          }
104        }/*else{
105          tpl_link(wl($ID,'do=edit&amp;rev='.$REV),
106                   $pre.$lang['btn_source'].$suf,
107                   'class="action" accesskey="v" rel="nofollow"');
108        } */
109      }else{
110          tpl_link(wl($ID,'do=show'),
111                   $pre.$lang['btn_show'].$suf,
112                   'class="action" accesskey="v" rel="nofollow"');
113      }
114      break;
115    case 'help':
116      tpl_link(wl('wiki:help','do=show'),$pre.$lang['btn_help'].$suf,'class="action" accesskey="h"');
117      break;
118    case 'about':
119      tpl_link(wl('wiki:about','do=show'),$pre.$lang['btn_about'].$suf,'class="action" ');
120      break;
121    case 'top':
122      print '<a href="#top" class="action" accesskey="x">'.$pre.$lang['btn_top'].$suf.'</a>';
123      break;
124    case 'back':
125        tpl_link(wl($ID,'do=backlink'),$pre.$lang['btn_back'].$suf,'class="action" accesskey="b"');
126      break;
127    case 'login':
128      if($conf['useacl']){
129        if($_SERVER['REMOTE_USER']){
130          tpl_link(wl($ID,'do=logout'),$pre.$lang['btn_logout'].$suf,'class="action"');
131        }else{
132          tpl_link(wl($ID,'do=login'),$pre.$lang['btn_login'].$suf,'class="action"');
133        }
134      }
135      break;
136    case 'admin':
137      if($INFO['perm'] == AUTH_ADMIN)
138        tpl_link(wl($ID,'do=admin'),$pre.$lang['btn_admin'].$suf,'class="action"');
139      break;
140
141// !! ADDED FOR PROFILE !!
142    case 'profile':
143      if($conf['useacl']){
144        if($_SERVER['REMOTE_USER']){
145          tpl_link(wl($ID,'do=profile'),$pre.$lang['btn_profile'].$suf,'class="action"');
146        }
147      }
148      break;
149// !! ADDED FOR PROFILE !!
150
151
152    default:
153      print '[unknown link type]';
154  }
155}
156
157
158  ?>
159