Annotation of /mambo/branches/4.6/administrator/includes/menubar.html.php
Parent Directory
|
Revision Log
Revision 1756 - (view) (download)
| 1 : | root | 1 | <?php |
| 2 : | /** | ||
| 3 : | elpie | 964 | * @package Mambo |
| 4 : | * @author Mambo Foundation Inc see README.php | ||
| 5 : | elpie | 1756 | * @copyright (C) 2000 - 2009 Mambo Foundation Inc. |
| 6 : | elpie | 1037 | * See COPYRIGHT.php for copyright notices and details. |
| 7 : | ocs_cms | 1396 | * @license GNU/GPL Version 2, see LICENSE.php |
| 8 : | elpie | 1756 | * |
| 9 : | * Redistributions of files must retain the above copyright notice. | ||
| 10 : | * | ||
| 11 : | elpie | 1037 | * Mambo is free software; you can redistribute it and/or |
| 12 : | * modify it under the terms of the GNU General Public License | ||
| 13 : | ocs_cms | 1396 | * as published by the Free Software Foundation; version 2 of the License. |
| 14 : | */ | ||
| 15 : | root | 1 | |
| 16 : | /** | ||
| 17 : | * Utility class for the button bar | ||
| 18 : | */ | ||
| 19 : | class mosMenuBar { | ||
| 20 : | |||
| 21 : | csouza | 403 | /** |
| 22 : | root | 1 | * Writes the start of the button bar table |
| 23 : | */ | ||
| 24 : | csouza | 403 | function startTable() { |
| 25 : | root | 1 | ?> |
| 26 : | elpie | 1752 | <script type="text/javascript"> |
| 27 : | root | 1 | <!-- |
| 28 : | function MM_swapImgRestore() { //v3.0 | ||
| 29 : | csouza | 403 | var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; |
| 30 : | root | 1 | } |
| 31 : | //--> | ||
| 32 : | </script> | ||
| 33 : | <table cellpadding="3" cellspacing="0" border="0"> | ||
| 34 : | <tr> | ||
| 35 : | <?php | ||
| 36 : | csouza | 403 | } |
| 37 : | root | 1 | |
| 38 : | csouza | 403 | /** |
| 39 : | root | 1 | * Writes a custom option and task button for the button bar |
| 40 : | * @param string The task to perform (picked up by the switch($task) blocks | ||
| 41 : | * @param string The image to display | ||
| 42 : | * @param string The image to display when moused over | ||
| 43 : | * @param string The alt text for the icon image | ||
| 44 : | * @param boolean True if required to check that a standard list item is checked | ||
| 45 : | */ | ||
| 46 : | csouza | 403 | function custom( $task='', $icon='', $iconOver='', $alt='', $listSelect=true, $prefix='' ) { |
| 47 : | if ($listSelect) { | ||
| 48 : | andphe | 1684 | $href = "javascript:if (document.adminForm.boxchecked.value == 0){ alert('".sprintf(T_('Please make a selection from the list to %s'),$alt)."');}else{".$prefix."submitbutton('$task')}"; |
| 49 : | csouza | 403 | } else { |
| 50 : | $href = "javascript:".$prefix."submitbutton('$task')"; | ||
| 51 : | } | ||
| 52 : | if ($icon && $iconOver) { | ||
| 53 : | root | 1 | ?> |
| 54 : | <td> | ||
| 55 : | <a class="toolbar" href="<?php echo $href;?>" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','images/<?php echo $iconOver;?>',1);"> | ||
| 56 : | cauld | 683 | <img name="<?php echo $task;?>" src="images/<?php echo $icon;?>" alt="<?php echo $alt;?>" border="0" align="middle" /><br /> |
| 57 : | root | 1 | <?php echo $alt; ?></a> |
| 58 : | </td> | ||
| 59 : | <?php | ||
| 60 : | csouza | 403 | } else { |
| 61 : | root | 1 | ?> |
| 62 : | <td> | ||
| 63 : | <a class="toolbar" href="<?php echo $href;?>"> | ||
| 64 : | cauld | 683 | <br /> |
| 65 : | root | 1 | <?php echo $alt; ?></a> |
| 66 : | </td> | ||
| 67 : | <?php | ||
| 68 : | csouza | 403 | } |
| 69 : | } | ||
| 70 : | root | 1 | |
| 71 : | csouza | 403 | /** |
| 72 : | root | 1 | * Writes a custom option and task button for the button bar. |
| 73 : | * Extended version of custom() calling hideMainMenu() before submitbutton(). | ||
| 74 : | * @param string The task to perform (picked up by the switch($task) blocks | ||
| 75 : | * @param string The image to display | ||
| 76 : | * @param string The image to display when moused over | ||
| 77 : | * @param string The alt text for the icon image | ||
| 78 : | * @param boolean True if required to check that a standard list item is checked | ||
| 79 : | */ | ||
| 80 : | csouza | 403 | function customX( $task='', $icon='', $iconOver='', $alt='', $listSelect=true ) { |
| 81 : | mosMenuBar::custom ($task, $icon, $iconOver, $alt, $listSelect, 'hideMainMenu();'); | ||
| 82 : | } | ||
| 83 : | |||
| 84 : | /** | ||
| 85 : | counterpoi | 400 | t * Standard routine for displaying toolbar icon |
| 86 : | t * @param string An override for the task | ||
| 87 : | t * @param string An override for the alt text | ||
| 88 : | t * @param string The name to be used as a legend and as the image name | ||
| 89 : | t * @param | ||
| 90 : | t */ | ||
| 91 : | csouza | 403 | function addToToolBar ($task, $alt, $name, $imagename, $extended=false, $listprompt='') { |
| 92 : | csouza | 556 | if (is_null($alt)) $alt = T_($name); |
| 93 : | csouza | 403 | $image = mosAdminMenus::ImageCheckAdmin( $imagename.'.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 94 : | $image2 = mosAdminMenus::ImageCheckAdmin( $imagename.'_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 95 : | root | 1 | ?> |
| 96 : | <td> | ||
| 97 : | counterpoi | 400 | t <a class="toolbar" href="javascript:<?php echo mosMenuBar::makeJavaScript ($task, $extended, $listprompt); ?>" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
| 98 : | root | 1 | <?php |
| 99 : | counterpoi | 400 | t echo $image; |
| 100 : | cauld | 683 | echo '<br />'; |
| 101 : | counterpoi | 400 | t echo $alt; |
| 102 : | root | 1 | ?> |
| 103 : | counterpoi | 400 | t </a> |
| 104 : | root | 1 | </td> |
| 105 : | <?php | ||
| 106 : | csouza | 403 | } |
| 107 : | root | 1 | |
| 108 : | csouza | 403 | function makeJavaScript ($task, $extended, $listprompt='') { |
| 109 : | $script = ''; | ||
| 110 : | if ($listprompt) $script .= "if (document.adminForm.boxchecked.value == 0){ alert('$listprompt'); } else"; | ||
| 111 : | $script .= '{'; | ||
| 112 : | if ($extended) $script .= 'hideMainMenu();'; | ||
| 113 : | $script .= "submitbutton('$task')}"; | ||
| 114 : | return $script; | ||
| 115 : | } | ||
| 116 : | counterpoi | 400 | t |
| 117 : | andphe | 1754 | // @RawSQLUse, trivial_implementation, SELECT |
| 118 : | csouza | 403 | function getTemplate () { |
| 119 : | global $database; | ||
| 120 : | $sql = "SELECT template FROM #__templates_menu WHERE client_id='1' AND menuid='0'"; | ||
| 121 : | $database->setQuery( $sql ); | ||
| 122 : | return $database->loadResult(); | ||
| 123 : | } | ||
| 124 : | |||
| 125 : | /** | ||
| 126 : | root | 1 | * Writes the common 'new' icon for the button bar |
| 127 : | * @param string An override for the task | ||
| 128 : | * @param string An override for the alt text | ||
| 129 : | */ | ||
| 130 : | csouza | 403 | function addNew( $task='new', $alt=null ) { |
| 131 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('New'), 'new'); |
| 132 : | csouza | 403 | } |
| 133 : | root | 1 | |
| 134 : | csouza | 403 | /** |
| 135 : | root | 1 | * Writes the common 'new' icon for the button bar. |
| 136 : | * Extended version of addNew() calling hideMainMenu() before submitbutton(). | ||
| 137 : | * @param string An override for the task | ||
| 138 : | * @param string An override for the alt text | ||
| 139 : | */ | ||
| 140 : | csouza | 403 | function addNewX( $task='new', $alt=null ) { |
| 141 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('New'), 'new', true); |
| 142 : | csouza | 403 | } |
| 143 : | root | 1 | |
| 144 : | csouza | 403 | /** |
| 145 : | root | 1 | * Writes a common 'publish' button |
| 146 : | * @param string An override for the task | ||
| 147 : | * @param string An override for the alt text | ||
| 148 : | */ | ||
| 149 : | csouza | 403 | function publish( $task='publish', $alt=null ) { |
| 150 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Publish'), 'publish'); |
| 151 : | csouza | 403 | } |
| 152 : | root | 1 | |
| 153 : | csouza | 403 | /** |
| 154 : | root | 1 | * Writes a common 'publish' button for a list of records |
| 155 : | * @param string An override for the task | ||
| 156 : | * @param string An override for the alt text | ||
| 157 : | */ | ||
| 158 : | csouza | 403 | function publishList( $task='publish', $alt=null ) { |
| 159 : | csouza | 556 | $listprompt = T_('Please make a selection from the list to publish'); |
| 160 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Publish'), 'publish', false, $listprompt); |
| 161 : | csouza | 403 | } |
| 162 : | root | 1 | |
| 163 : | csouza | 403 | /** |
| 164 : | root | 1 | * Writes a common 'default' button for a record |
| 165 : | * @param string An override for the task | ||
| 166 : | * @param string An override for the alt text | ||
| 167 : | */ | ||
| 168 : | csouza | 403 | function makeDefault( $task='default', $alt=null ) { |
| 169 : | csouza | 556 | $listprompt = T_('Please select an item to make default'); |
| 170 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Default'), 'publish', false, $listprompt); |
| 171 : | csouza | 403 | } |
| 172 : | root | 1 | |
| 173 : | csouza | 403 | /** |
| 174 : | root | 1 | * Writes a common 'assign' button for a record |
| 175 : | * @param string An override for the task | ||
| 176 : | * @param string An override for the alt text | ||
| 177 : | */ | ||
| 178 : | csouza | 403 | function assign( $task='assign', $alt=null ) { |
| 179 : | csouza | 556 | $listprompt = T_('Please select an item to assign'); |
| 180 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Assign'), 'publish', false, $listprompt); |
| 181 : | csouza | 403 | } |
| 182 : | root | 1 | |
| 183 : | csouza | 403 | /** |
| 184 : | root | 1 | * Writes a common 'unpublish' button |
| 185 : | * @param string An override for the task | ||
| 186 : | * @param string An override for the alt text | ||
| 187 : | */ | ||
| 188 : | csouza | 403 | function unpublish( $task='unpublish', $alt=null ) { |
| 189 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Unpublish'), 'unpublish'); |
| 190 : | csouza | 403 | } |
| 191 : | root | 1 | |
| 192 : | csouza | 403 | /** |
| 193 : | root | 1 | * Writes a common 'unpublish' button for a list of records |
| 194 : | * @param string An override for the task | ||
| 195 : | * @param string An override for the alt text | ||
| 196 : | */ | ||
| 197 : | csouza | 403 | function unpublishList( $task='unpublish', $alt=null ) { |
| 198 : | csouza | 556 | $listprompt = T_('Please make a selection from the list to unpublish'); |
| 199 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Unpublish'), 'unpublish', false, $listprompt); |
| 200 : | csouza | 403 | } |
| 201 : | root | 1 | |
| 202 : | csouza | 403 | /** |
| 203 : | root | 1 | * Writes a common 'archive' button for a list of records |
| 204 : | * @param string An override for the task | ||
| 205 : | * @param string An override for the alt text | ||
| 206 : | */ | ||
| 207 : | csouza | 403 | function archiveList( $task='archive', $alt=null ) { |
| 208 : | csouza | 556 | $listprompt = T_('Please make a selection from the list to archive'); |
| 209 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Archive'), 'archive', false, $listprompt); |
| 210 : | csouza | 403 | } |
| 211 : | root | 1 | |
| 212 : | csouza | 403 | /** |
| 213 : | root | 1 | * Writes an unarchive button for a list of records |
| 214 : | * @param string An override for the task | ||
| 215 : | * @param string An override for the alt text | ||
| 216 : | */ | ||
| 217 : | csouza | 403 | function unarchiveList( $task='unarchive', $alt=null ) { |
| 218 : | csouza | 556 | $listprompt = T_('Please select a news story to unarchive'); |
| 219 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Unarchive'), 'unarchive', false, $listprompt); |
| 220 : | csouza | 403 | } |
| 221 : | root | 1 | |
| 222 : | csouza | 403 | /** |
| 223 : | root | 1 | * Writes a common 'edit' button for a list of records |
| 224 : | * @param string An override for the task | ||
| 225 : | * @param string An override for the alt text | ||
| 226 : | */ | ||
| 227 : | csouza | 403 | function editList( $task='edit', $alt=null ) { |
| 228 : | csouza | 556 | $listprompt = T_('Please select an item from the list to edit'); |
| 229 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Edit'), 'edit', false, $listprompt); |
| 230 : | csouza | 403 | } |
| 231 : | root | 1 | |
| 232 : | csouza | 403 | /** |
| 233 : | root | 1 | * Writes a common 'edit' button for a list of records. |
| 234 : | * Extended version of editList() calling hideMainMenu() before submitbutton(). | ||
| 235 : | * @param string An override for the task | ||
| 236 : | * @param string An override for the alt text | ||
| 237 : | */ | ||
| 238 : | csouza | 403 | function editListX( $task='edit', $alt=null ) { |
| 239 : | csouza | 556 | $listprompt = T_('Please select an item from the list to edit'); |
| 240 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Edit'), 'edit', true, $listprompt); |
| 241 : | csouza | 403 | } |
| 242 : | root | 1 | |
| 243 : | csouza | 403 | /** |
| 244 : | root | 1 | * Writes a common 'edit' button for a template html |
| 245 : | * @param string An override for the task | ||
| 246 : | * @param string An override for the alt text | ||
| 247 : | */ | ||
| 248 : | csouza | 403 | function editHtml( $task='edit_source', $alt=null ) { |
| 249 : | csouza | 556 | $listprompt = T_('Please select an item from the list to edit'); |
| 250 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Edit HTML'), 'html', false, $listprompt); |
| 251 : | csouza | 403 | } |
| 252 : | root | 1 | |
| 253 : | csouza | 403 | /** |
| 254 : | root | 1 | * Writes a common 'edit' button for a template html. |
| 255 : | * Extended version of editHtml() calling hideMainMenu() before submitbutton(). | ||
| 256 : | * @param string An override for the task | ||
| 257 : | * @param string An override for the alt text | ||
| 258 : | */ | ||
| 259 : | csouza | 403 | function editHtmlX( $task='edit_source', $alt=null ) { |
| 260 : | csouza | 556 | $listprompt = T_('Please select an item from the list to edit'); |
| 261 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Edit HTML'), 'html', true, $listprompt); |
| 262 : | csouza | 403 | } |
| 263 : | root | 1 | |
| 264 : | csouza | 403 | /** |
| 265 : | root | 1 | * Writes a common 'edit' button for a template css |
| 266 : | * @param string An override for the task | ||
| 267 : | * @param string An override for the alt text | ||
| 268 : | */ | ||
| 269 : | csouza | 403 | function editCss( $task='edit_css', $alt=null ) { |
| 270 : | csouza | 556 | $listprompt = T_('Please select an item from the list to edit'); |
| 271 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Edit CSS'), 'css', false, $listprompt); |
| 272 : | csouza | 403 | } |
| 273 : | root | 1 | |
| 274 : | csouza | 403 | /** |
| 275 : | root | 1 | * Writes a common 'edit' button for a template css. |
| 276 : | * Extended version of editCss() calling hideMainMenu() before submitbutton(). | ||
| 277 : | * @param string An override for the task | ||
| 278 : | * @param string An override for the alt text | ||
| 279 : | */ | ||
| 280 : | csouza | 403 | function editCssX( $task='edit_css', $alt=null ) { |
| 281 : | csouza | 556 | $listprompt = T_('Please select an item from the list to edit'); |
| 282 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Edit CSS'), 'css', true, $listprompt); |
| 283 : | csouza | 403 | } |
| 284 : | root | 1 | |
| 285 : | csouza | 403 | /** |
| 286 : | root | 1 | * Writes a common 'delete' button for a list of records |
| 287 : | * @param string Postscript for the 'are you sure' message | ||
| 288 : | * @param string An override for the task | ||
| 289 : | * @param string An override for the alt text | ||
| 290 : | */ | ||
| 291 : | csouza | 403 | function deleteList( $msg='', $task='remove', $alt=null ) { |
| 292 : | csouza | 556 | $listprompt = T_('Please make a selection from the list to delete'); |
| 293 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Delete'), 'delete', false, $listprompt); |
| 294 : | csouza | 403 | } |
| 295 : | root | 1 | |
| 296 : | csouza | 403 | /** |
| 297 : | root | 1 | * Writes a common 'delete' button for a list of records. |
| 298 : | * Extended version of deleteList() calling hideMainMenu() before submitbutton(). | ||
| 299 : | * @param string Postscript for the 'are you sure' message | ||
| 300 : | * @param string An override for the task | ||
| 301 : | * @param string An override for the alt text | ||
| 302 : | */ | ||
| 303 : | csouza | 403 | function deleteListX( $msg='', $task='remove', $alt=null ) { |
| 304 : | csouza | 556 | $listprompt = T_('Please make a selection from the list to delete'); |
| 305 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Delete'), 'delete', true, $listprompt); |
| 306 : | csouza | 403 | } |
| 307 : | root | 1 | |
| 308 : | csouza | 403 | /** |
| 309 : | root | 1 | * Write a trash button that will move items to Trash Manager |
| 310 : | */ | ||
| 311 : | csouza | 403 | function trash( $task='remove', $alt=null ) { |
| 312 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Trash'), 'delete'); |
| 313 : | csouza | 403 | } |
| 314 : | root | 1 | |
| 315 : | csouza | 403 | /** |
| 316 : | root | 1 | * Writes a preview button for a given option (opens a popup window) |
| 317 : | * @param string The name of the popup file (excluding the file extension) | ||
| 318 : | */ | ||
| 319 : | csouza | 403 | function preview( $popup='', $updateEditors=false ) { |
| 320 : | csouza | 556 | $image = mosAdminMenus::ImageCheckAdmin( 'preview.png', '/administrator/images/', NULL, NULL, T_('Preview'), 'preview' ); |
| 321 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'preview_f2.png', '/administrator/images/', NULL, NULL, T_('Preview'), 'preview', 0 ); | ||
| 322 : | csouza | 403 | $cur_template = mosMenuBar::getTemplate(); |
| 323 : | root | 1 | ?> |
| 324 : | <td> | ||
| 325 : | elpie | 1752 | <script type="text/javascript"> |
| 326 : | root | 1 | function popup() { |
| 327 : | csouza | 403 | <?php |
| 328 : | if ($popup == 'contentwindow') { | ||
| 329 : | getEditorContents( 'editor1', 'introtext' ); | ||
| 330 : | getEditorContents( 'editor2', 'fulltext' ); | ||
| 331 : | } | ||
| 332 : | elseif ($popup == 'modulewindow') getEditorContents( 'editor1', 'content' ); | ||
| 333 : | ?> | ||
| 334 : | ninekrit | 889 | window.open('index3.php?pop=/<?php echo $popup;?>.php&t=<?php echo $cur_template; ?>', 'win1', 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no'); |
| 335 : | root | 1 | } |
| 336 : | </script> | ||
| 337 : | <a class="toolbar" href="#" onclick="popup();" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('preview','','<?php echo $image2; ?>',1);"> | ||
| 338 : | ninekrit | 663 | <?php echo $image; ?><br /> |
| 339 : | <?php echo T_('Preview'); ?> | ||
| 340 : | root | 1 | </a> |
| 341 : | </td> | ||
| 342 : | <?php | ||
| 343 : | csouza | 403 | } |
| 344 : | root | 1 | |
| 345 : | csouza | 403 | /** |
| 346 : | root | 1 | * Writes a preview button for a given option (opens a popup window) |
| 347 : | * @param string The name of the popup file (excluding the file extension for an xml file) | ||
| 348 : | * @param boolean Use the help file in the component directory | ||
| 349 : | */ | ||
| 350 : | csouza | 403 | function help( $ref, $com=false ) { |
| 351 : | csouza | 556 | $image = mosAdminMenus::ImageCheckAdmin( 'help.png', '/administrator/images/', NULL, NULL, T_('Help'), 'help' ); |
| 352 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'help_f2.png', '/administrator/images/', NULL, NULL, T_('Help'), 'help', 0 ); | ||
| 353 : | csouza | 410 | $mosConfig_live_site = mamboCore::get('mosConfig_live_site'); |
| 354 : | $rootpath = mamboCore::get('rootPath'); | ||
| 355 : | csouza | 403 | /*$helpUrl = mosGetParam( $GLOBALS, 'mosConfig_helpurl', '' ); |
| 356 : | if ($helpUrl) { | ||
| 357 : | $url = $helpUrl . '/index2.php?option=com_content&task=findkey&pop=1&keyref=' . urlencode( $ref ); | ||
| 358 : | } else {*/ | ||
| 359 : | csouza | 550 | $option = $GLOBALS['option']; |
| 360 : | if (substr($option,0,4) != 'com_') $option = "com_$option"; | ||
| 361 : | $component = substr($option, 4); | ||
| 362 : | csouza | 403 | if ($com) { |
| 363 : | andphe | 940 | $url = '/administrator/components/' . $option . '/help/'; |
| 364 : | }else{ | ||
| 365 : | $url = '/help/'; | ||
| 366 : | csouza | 403 | } |
| 367 : | csouza | 550 | $ref = $component.'.'.$ref . '.html'; |
| 368 : | csouza | 403 | $url .= $ref; |
| 369 : | |||
| 370 : | andphe | 940 | if (!file_exists($rootpath.'/help/'.$ref)) return false; |
| 371 : | $url = $mosConfig_live_site . $url; | ||
| 372 : | |||
| 373 : | csouza | 410 | |
| 374 : | csouza | 403 | /*}*/ |
| 375 : | |||
| 376 : | root | 1 | ?> |
| 377 : | <td> | ||
| 378 : | <a class="toolbar" href="#" onclick="window.open('<?php echo $url;?>', 'mambo_help_win', 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('help','','<?php echo $image2; ?>',1);"> | ||
| 379 : | cauld | 683 | <?php echo $image . '<br />' . T_('Help'); ?> |
| 380 : | root | 1 | </a> |
| 381 : | </td> | ||
| 382 : | <?php | ||
| 383 : | csouza | 403 | } |
| 384 : | root | 1 | |
| 385 : | csouza | 403 | /** |
| 386 : | root | 1 | * Writes a save button for a given option |
| 387 : | * Apply operation leads to a save action only (does not leave edit mode) | ||
| 388 : | * @param string An override for the task | ||
| 389 : | * @param string An override for the alt text | ||
| 390 : | */ | ||
| 391 : | csouza | 403 | function apply( $task='apply', $alt=null ) { |
| 392 : | csouza | 556 | mosMenuBar::addToToolBar ($task, $alt, T_('Apply'), 'apply'); |
| 393 : | csouza | 403 | } |
| 394 : | root | 1 | |
| 395 : | csouza | 403 | /** |
| 396 : | root | 1 | * Writes a save button for a given option |
| 397 : | * Save operation leads to a save and then close action | ||
| 398 : | * @param string An override for the task | ||
| 399 : | * @param string An override for the alt text | ||
| 400 : | */ | ||
| 401 : | csouza | 403 | function save( $task='save', $alt=null ) { |
| 402 : | csouza | 556 | mosMenuBar::addToToolBar ($task, $alt, T_('Save'), 'save'); |
| 403 : | csouza | 403 | } |
| 404 : | root | 1 | |
| 405 : | csouza | 403 | /** |
| 406 : | root | 1 | * Writes a save button for a given option (NOTE this is being deprecated) |
| 407 : | */ | ||
| 408 : | csouza | 403 | function savenew() { |
| 409 : | $image = mosAdminMenus::ImageCheckAdmin( 'save.png', '/administrator/images/', NULL, NULL, 'save', 'save' ); | ||
| 410 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'save_f2.png', '/administrator/images/', NULL, NULL, 'save', 'save', 0 ); | ||
| 411 : | root | 1 | ?> |
| 412 : | <td> | ||
| 413 : | <a class="toolbar" href="javascript:submitbutton('savenew');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('save','','<?php echo $image2; ?>',1);"> | ||
| 414 : | ninekrit | 663 | <?php echo $image; ?><br /> |
| 415 : | <?php echo T_('Save'); ?> | ||
| 416 : | root | 1 | </a> |
| 417 : | </td> | ||
| 418 : | <?php | ||
| 419 : | csouza | 403 | } |
| 420 : | root | 1 | |
| 421 : | csouza | 403 | /** |
| 422 : | root | 1 | * Writes a save button for a given option (NOTE this is being deprecated) |
| 423 : | */ | ||
| 424 : | csouza | 403 | function saveedit() { |
| 425 : | $image = mosAdminMenus::ImageCheckAdmin( 'save.png', '/administrator/images/', NULL, NULL, 'save', 'save' ); | ||
| 426 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'save_f2.png', '/administrator/images/', NULL, NULL, 'save', 'save', 0 ); | ||
| 427 : | root | 1 | ?> |
| 428 : | <td> | ||
| 429 : | <a class="toolbar" href="javascript:submitbutton('saveedit');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('save','','<?php echo $image2; ?>',1);"> | ||
| 430 : | ninekrit | 663 | <?php echo $image; ?><br /> |
| 431 : | <?php echo T_('Save'); ?> | ||
| 432 : | root | 1 | </a> |
| 433 : | </td> | ||
| 434 : | <?php | ||
| 435 : | csouza | 403 | } |
| 436 : | root | 1 | |
| 437 : | csouza | 403 | /** |
| 438 : | root | 1 | * Writes a cancel button and invokes a cancel operation (eg a checkin) |
| 439 : | * @param string An override for the task | ||
| 440 : | * @param string An override for the alt text | ||
| 441 : | */ | ||
| 442 : | csouza | 403 | function cancel( $task='cancel', $alt=null ) { |
| 443 : | andphe | 1000 | mosMenuBar::addToToolBar ($task, $alt, T_('Cancel'), 'cancel'); |
| 444 : | csouza | 403 | } |
| 445 : | root | 1 | |
| 446 : | csouza | 403 | /** |
| 447 : | root | 1 | * Writes a cancel button that will go back to the previous page without doing |
| 448 : | * any other operation | ||
| 449 : | */ | ||
| 450 : | csouza | 403 | function back( $alt=null, $href='' ) { |
| 451 : | csouza | 556 | if (is_null($alt)) $alt = T_('Back'); |
| 452 : | csouza | 403 | $image = mosAdminMenus::ImageCheckAdmin( 'back.png', '/administrator/images/', NULL, NULL, 'back', 'cancel' ); |
| 453 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'back_f2.png', '/administrator/images/', NULL, NULL, 'back', 'cancel', 0 ); | ||
| 454 : | if ( $href ) { | ||
| 455 : | $link = $href; | ||
| 456 : | } else { | ||
| 457 : | $link = 'javascript:window.history.back();'; | ||
| 458 : | } | ||
| 459 : | root | 1 | ?> |
| 460 : | <td> | ||
| 461 : | <a class="toolbar" href="<?php echo $link; ?>" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('cancel','','<?php echo $image2; ?>',1);"> | ||
| 462 : | ninekrit | 663 | <?php echo $image; ?><br /> |
| 463 : | root | 1 | <?php echo $alt;?> |
| 464 : | </a> | ||
| 465 : | </td> | ||
| 466 : | <?php | ||
| 467 : | csouza | 403 | } |
| 468 : | root | 1 | |
| 469 : | csouza | 403 | /** |
| 470 : | root | 1 | * Write a divider between menu buttons |
| 471 : | */ | ||
| 472 : | csouza | 403 | function divider() { |
| 473 : | $image = mosAdminMenus::ImageCheckAdmin( 'menu_divider.png', '/administrator/images/' ); | ||
| 474 : | root | 1 | ?> |
| 475 : | <td> | ||
| 476 : | <?php echo $image; ?> | ||
| 477 : | </td> | ||
| 478 : | <?php | ||
| 479 : | csouza | 403 | } |
| 480 : | root | 1 | |
| 481 : | csouza | 403 | /** |
| 482 : | root | 1 | * Writes a media_manager button |
| 483 : | * @param string The sub-drectory to upload the media to | ||
| 484 : | */ | ||
| 485 : | csouza | 403 | function media_manager( $directory = '', $alt=null ) { |
| 486 : | csouza | 556 | if (is_null($alt)) $alt = T_('Upload'); |
| 487 : | csouza | 403 | $cur_template = mosMenuBar::getTemplate(); |
| 488 : | csouza | 556 | $image = mosAdminMenus::ImageCheckAdmin( 'upload.png', '/administrator/images/', NULL, NULL, T_('Upload Image'), 'uploadPic' ); |
| 489 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'upload_f2.png', '/administrator/images/', NULL, NULL, T_('Upload Image'), 'uploadPic', 0 ); | ||
| 490 : | root | 1 | ?> |
| 491 : | <td> | ||
| 492 : | ninekrit | 889 | <a class="toolbar" href="#" onclick="popupWindow('index3.php?pop=uploadimage.php&directory=<?php echo $directory; ?>&t=<?php echo $cur_template; ?>','win1',350,100,'no');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('uploadPic','','<?php echo $image2; ?>',1);"> |
| 493 : | ninekrit | 663 | <?php echo $image; ?><br /> |
| 494 : | root | 1 | <?php echo $alt;?> |
| 495 : | </a> | ||
| 496 : | </td> | ||
| 497 : | <?php | ||
| 498 : | csouza | 403 | } |
| 499 : | root | 1 | |
| 500 : | csouza | 403 | /** |
| 501 : | root | 1 | * Writes a spacer cell |
| 502 : | * @param string The width for the cell | ||
| 503 : | */ | ||
| 504 : | csouza | 403 | function spacer( $width='' ) |
| 505 : | { | ||
| 506 : | if ($width != '') { | ||
| 507 : | root | 1 | ?> |
| 508 : | <td width="<?php echo $width;?>"> </td> | ||
| 509 : | <?php | ||
| 510 : | csouza | 403 | } else { |
| 511 : | root | 1 | ?> |
| 512 : | <td> </td> | ||
| 513 : | <?php | ||
| 514 : | csouza | 403 | } |
| 515 : | } | ||
| 516 : | root | 1 | |
| 517 : | csouza | 403 | /** |
| 518 : | root | 1 | * Writes the end of the menu bar table |
| 519 : | */ | ||
| 520 : | csouza | 403 | function endTable() { |
| 521 : | root | 1 | ?> |
| 522 : | </tr> | ||
| 523 : | </table> | ||
| 524 : | <?php | ||
| 525 : | csouza | 403 | } |
| 526 : | root | 1 | } |
| 527 : | counterpoi | 400 | t ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

