Annotation of /mambo/branches/4.6/administrator/includes/menubar.html.php
Parent Directory
|
Revision Log
Revision 214 - (view) (download)
| 1 : | root | 1 | <?php |
| 2 : | /** | ||
| 3 : | * @version $Id: menubar.html.php,v 1.1 2005/07/22 01:53:54 eddieajau Exp $ | ||
| 4 : | * @package Mambo | ||
| 5 : | * @copyright (C) 2000 - 2005 Miro International Pty Ltd | ||
| 6 : | * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||
| 7 : | * Mambo is Free Software | ||
| 8 : | */ | ||
| 9 : | |||
| 10 : | /** | ||
| 11 : | * Utility class for the button bar | ||
| 12 : | * @package Mambo | ||
| 13 : | */ | ||
| 14 : | class mosMenuBar { | ||
| 15 : | |||
| 16 : | /** | ||
| 17 : | * Writes the start of the button bar table | ||
| 18 : | */ | ||
| 19 : | function startTable() { | ||
| 20 : | ?> | ||
| 21 : | <script language="JavaScript" type="text/JavaScript"> | ||
| 22 : | <!-- | ||
| 23 : | function MM_swapImgRestore() { //v3.0 | ||
| 24 : | var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; | ||
| 25 : | } | ||
| 26 : | //--> | ||
| 27 : | </script> | ||
| 28 : | <table cellpadding="3" cellspacing="0" border="0"> | ||
| 29 : | <tr> | ||
| 30 : | <?php | ||
| 31 : | } | ||
| 32 : | |||
| 33 : | /** | ||
| 34 : | * Writes a custom option and task button for the button bar | ||
| 35 : | * @param string The task to perform (picked up by the switch($task) blocks | ||
| 36 : | * @param string The image to display | ||
| 37 : | * @param string The image to display when moused over | ||
| 38 : | * @param string The alt text for the icon image | ||
| 39 : | * @param boolean True if required to check that a standard list item is checked | ||
| 40 : | */ | ||
| 41 : | function custom( $task='', $icon='', $iconOver='', $alt='', $listSelect=true ) { | ||
| 42 : | if ($listSelect) { | ||
| 43 : | csouza | 149 | $href = "javascript:if (document.adminForm.boxchecked.value == 0){ alert('".sprintf(T_('Please make a selection from the list to %s'),$alt)."');}else{submitbutton('$task')}"; |
| 44 : | root | 1 | } else { |
| 45 : | $href = "javascript:submitbutton('$task')"; | ||
| 46 : | } | ||
| 47 : | if ($icon && $iconOver) { | ||
| 48 : | ?> | ||
| 49 : | <td> | ||
| 50 : | <a class="toolbar" href="<?php echo $href;?>" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','images/<?php echo $iconOver;?>',1);"> | ||
| 51 : | <img name="<?php echo $task;?>" src="images/<?php echo $icon;?>" alt="<?php echo $alt;?>" border="0" align="middle" /> | ||
| 52 : | | ||
| 53 : | <?php echo $alt; ?></a> | ||
| 54 : | </td> | ||
| 55 : | <?php | ||
| 56 : | } else { | ||
| 57 : | ?> | ||
| 58 : | <td> | ||
| 59 : | <a class="toolbar" href="<?php echo $href;?>"> | ||
| 60 : | | ||
| 61 : | <?php echo $alt; ?></a> | ||
| 62 : | </td> | ||
| 63 : | <?php | ||
| 64 : | } | ||
| 65 : | } | ||
| 66 : | |||
| 67 : | /** | ||
| 68 : | * Writes a custom option and task button for the button bar. | ||
| 69 : | * Extended version of custom() calling hideMainMenu() before submitbutton(). | ||
| 70 : | * @param string The task to perform (picked up by the switch($task) blocks | ||
| 71 : | * @param string The image to display | ||
| 72 : | * @param string The image to display when moused over | ||
| 73 : | * @param string The alt text for the icon image | ||
| 74 : | * @param boolean True if required to check that a standard list item is checked | ||
| 75 : | */ | ||
| 76 : | function customX( $task='', $icon='', $iconOver='', $alt='', $listSelect=true ) { | ||
| 77 : | if ($listSelect) { | ||
| 78 : | csouza | 149 | $href = "javascript:if (document.adminForm.boxchecked.value == 0){ alert('".sprintf(T_('Please make a selection from the list to %s'), $alt)."');}else{hideMainMenu();submitbutton('$task')}"; |
| 79 : | root | 1 | } else { |
| 80 : | $href = "javascript:hideMainMenu();submitbutton('$task')"; | ||
| 81 : | } | ||
| 82 : | if ($icon && $iconOver) { | ||
| 83 : | ?> | ||
| 84 : | <td> | ||
| 85 : | <a class="toolbar" href="<?php echo $href;?>" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','images/<?php echo $iconOver;?>',1);"> | ||
| 86 : | <img name="<?php echo $task;?>" src="images/<?php echo $icon;?>" alt="<?php echo $alt;?>" border="0" align="middle" /> | ||
| 87 : | | ||
| 88 : | <?php echo $alt; ?></a> | ||
| 89 : | </td> | ||
| 90 : | <?php | ||
| 91 : | } else { | ||
| 92 : | ?> | ||
| 93 : | <td> | ||
| 94 : | <a class="toolbar" href="<?php echo $href;?>"> | ||
| 95 : | | ||
| 96 : | <?php echo $alt; ?></a> | ||
| 97 : | </td> | ||
| 98 : | <?php | ||
| 99 : | } | ||
| 100 : | } | ||
| 101 : | |||
| 102 : | /** | ||
| 103 : | * Writes the common 'new' icon for the button bar | ||
| 104 : | * @param string An override for the task | ||
| 105 : | * @param string An override for the alt text | ||
| 106 : | */ | ||
| 107 : | csouza | 149 | function addNew( $task='new', $alt=null ) { |
| 108 : | if (is_null($alt)) $alt = T_('New'); | ||
| 109 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'new.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 110 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'new_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 111 : | ?> | ||
| 112 : | <td> | ||
| 113 : | <a class="toolbar" href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> | ||
| 114 : | <?php echo $image; ?> | ||
| 115 : | <?php echo $alt; ?> | ||
| 116 : | </a> | ||
| 117 : | </td> | ||
| 118 : | <?php | ||
| 119 : | } | ||
| 120 : | |||
| 121 : | /** | ||
| 122 : | * Writes the common 'new' icon for the button bar. | ||
| 123 : | * Extended version of addNew() calling hideMainMenu() before submitbutton(). | ||
| 124 : | * @param string An override for the task | ||
| 125 : | * @param string An override for the alt text | ||
| 126 : | */ | ||
| 127 : | csouza | 149 | function addNewX( $task='new', $alt=null ) { |
| 128 : | if (is_null($alt)) $alt = T_('New'); | ||
| 129 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'new.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 130 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'new_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 131 : | ?> | ||
| 132 : | <td> | ||
| 133 : | <a class="toolbar" href="javascript:hideMainMenu();submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> | ||
| 134 : | <?php echo $image; ?> | ||
| 135 : | <?php echo $alt; ?> | ||
| 136 : | </a> | ||
| 137 : | </td> | ||
| 138 : | <?php | ||
| 139 : | } | ||
| 140 : | |||
| 141 : | /** | ||
| 142 : | * Writes a common 'publish' button | ||
| 143 : | * @param string An override for the task | ||
| 144 : | * @param string An override for the alt text | ||
| 145 : | */ | ||
| 146 : | csouza | 149 | function publish( $task='publish', $alt=null ) { |
| 147 : | if (is_null($alt)) $alt = T_('Publish'); | ||
| 148 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'publish.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 149 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'publish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 150 : | ?> | ||
| 151 : | <td> | ||
| 152 : | <a class="toolbar" href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> | ||
| 153 : | <?php echo $image; ?> | ||
| 154 : | <?php echo $alt; ?> | ||
| 155 : | </a> | ||
| 156 : | </td> | ||
| 157 : | <?php | ||
| 158 : | } | ||
| 159 : | |||
| 160 : | /** | ||
| 161 : | * Writes a common 'publish' button for a list of records | ||
| 162 : | * @param string An override for the task | ||
| 163 : | * @param string An override for the alt text | ||
| 164 : | */ | ||
| 165 : | csouza | 149 | function publishList( $task='publish', $alt=null ) { |
| 166 : | if (is_null($alt)) $alt = T_('Publish'); | ||
| 167 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'publish.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 168 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'publish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 169 : | ?> | ||
| 170 : | <td> | ||
| 171 : | csouza | 149 | <a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please make a selection from the list to publish') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
| 172 : | root | 1 | <?php echo $image; ?> |
| 173 : | <?php echo $alt; ?> | ||
| 174 : | </a> | ||
| 175 : | </td> | ||
| 176 : | <?php | ||
| 177 : | } | ||
| 178 : | |||
| 179 : | /** | ||
| 180 : | * Writes a common 'default' button for a record | ||
| 181 : | * @param string An override for the task | ||
| 182 : | * @param string An override for the alt text | ||
| 183 : | */ | ||
| 184 : | csouza | 149 | function makeDefault( $task='default', $alt=null ) { |
| 185 : | if (is_null($alt)) $alt = T_('Default'); | ||
| 186 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'publish.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 187 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'publish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 188 : | ?> | ||
| 189 : | <td> | ||
| 190 : | csouza | 149 | <a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select an item to make default') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
| 191 : | root | 1 | <?php echo $image; ?> |
| 192 : | <?php echo $alt; ?> | ||
| 193 : | </a> | ||
| 194 : | </td> | ||
| 195 : | <?php | ||
| 196 : | } | ||
| 197 : | |||
| 198 : | /** | ||
| 199 : | * Writes a common 'assign' button for a record | ||
| 200 : | * @param string An override for the task | ||
| 201 : | * @param string An override for the alt text | ||
| 202 : | */ | ||
| 203 : | csouza | 149 | function assign( $task='assign', $alt=null ) { |
| 204 : | if (is_null($alt)) $alt = T_('Assign'); | ||
| 205 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'publish.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 206 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'publish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 207 : | ?> | ||
| 208 : | <td> | ||
| 209 : | csouza | 149 | <a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select an item to assign') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
| 210 : | root | 1 | <?php echo $image; ?> |
| 211 : | <?php echo $alt; ?> | ||
| 212 : | </a> | ||
| 213 : | </td> | ||
| 214 : | <?php | ||
| 215 : | } | ||
| 216 : | |||
| 217 : | /** | ||
| 218 : | * Writes a common 'unpublish' button | ||
| 219 : | * @param string An override for the task | ||
| 220 : | * @param string An override for the alt text | ||
| 221 : | */ | ||
| 222 : | csouza | 149 | function unpublish( $task='unpublish', $alt=null ) { |
| 223 : | if (is_null($alt)) $alt = T_('Unpublish'); | ||
| 224 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'unpublish.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 225 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'unpublish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 226 : | ?> | ||
| 227 : | <td> | ||
| 228 : | <a class="toolbar" href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);" > | ||
| 229 : | <?php echo $image; ?> | ||
| 230 : | <?php echo $alt; ?> | ||
| 231 : | </a> | ||
| 232 : | </td> | ||
| 233 : | <?php | ||
| 234 : | } | ||
| 235 : | |||
| 236 : | /** | ||
| 237 : | * Writes a common 'unpublish' button for a list of records | ||
| 238 : | * @param string An override for the task | ||
| 239 : | * @param string An override for the alt text | ||
| 240 : | */ | ||
| 241 : | csouza | 149 | function unpublishList( $task='unpublish', $alt=null ) { |
| 242 : | if (is_null($alt)) $alt = T_('Unpublish'); | ||
| 243 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'unpublish.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 244 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'unpublish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 245 : | ?> | ||
| 246 : | <td> | ||
| 247 : | csouza | 149 | <a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please make a selection from the list to unpublish') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);" > |
| 248 : | root | 1 | <?php echo $image; ?> |
| 249 : | <?php echo $alt; ?> | ||
| 250 : | </a> | ||
| 251 : | </td> | ||
| 252 : | <?php | ||
| 253 : | } | ||
| 254 : | |||
| 255 : | /** | ||
| 256 : | * Writes a common 'archive' button for a list of records | ||
| 257 : | * @param string An override for the task | ||
| 258 : | * @param string An override for the alt text | ||
| 259 : | */ | ||
| 260 : | csouza | 149 | function archiveList( $task='archive', $alt=null ) { |
| 261 : | if (is_null($alt)) $alt = T_('Archive'); | ||
| 262 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'archive.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 263 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'archive_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 264 : | ?> | ||
| 265 : | <td> | ||
| 266 : | csouza | 149 | <a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please make a selection from the list to archive') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
| 267 : | root | 1 | <?php echo $image; ?> |
| 268 : | <?php echo $alt; ?> | ||
| 269 : | </a> | ||
| 270 : | </td> | ||
| 271 : | <?php | ||
| 272 : | } | ||
| 273 : | |||
| 274 : | /** | ||
| 275 : | * Writes an unarchive button for a list of records | ||
| 276 : | * @param string An override for the task | ||
| 277 : | * @param string An override for the alt text | ||
| 278 : | */ | ||
| 279 : | csouza | 149 | function unarchiveList( $task='unarchive', $alt=null ) { |
| 280 : | if (is_null($alt)) $alt = T_('Unarchive'); | ||
| 281 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'unarchive.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 282 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'unarchive_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 283 : | ?> | ||
| 284 : | <td> | ||
| 285 : | csouza | 149 | <a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select a news story to unarchive') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
| 286 : | root | 1 | <?php echo $image; ?> |
| 287 : | <?php echo $alt; ?> | ||
| 288 : | </a> | ||
| 289 : | </td> | ||
| 290 : | <?php | ||
| 291 : | } | ||
| 292 : | |||
| 293 : | /** | ||
| 294 : | * Writes a common 'edit' button for a list of records | ||
| 295 : | * @param string An override for the task | ||
| 296 : | * @param string An override for the alt text | ||
| 297 : | */ | ||
| 298 : | csouza | 149 | function editList( $task='edit', $alt=null ) { |
| 299 : | if (is_null($alt)) $alt = T_('Edit'); | ||
| 300 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'edit.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 301 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'edit_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 302 : | ?> | ||
| 303 : | <td> | ||
| 304 : | csouza | 149 | <a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select an item from the list to edit') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
| 305 : | root | 1 | <?php echo $image; ?> |
| 306 : | <?php echo $alt; ?> | ||
| 307 : | </a> | ||
| 308 : | </td> | ||
| 309 : | <?php | ||
| 310 : | } | ||
| 311 : | |||
| 312 : | /** | ||
| 313 : | * Writes a common 'edit' button for a list of records. | ||
| 314 : | * Extended version of editList() calling hideMainMenu() before submitbutton(). | ||
| 315 : | * @param string An override for the task | ||
| 316 : | * @param string An override for the alt text | ||
| 317 : | */ | ||
| 318 : | csouza | 149 | function editListX( $task='edit', $alt=null ) { |
| 319 : | if (is_null($alt)) $alt = T_('Edit'); | ||
| 320 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'edit.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 321 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'edit_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 322 : | ?> | ||
| 323 : | <td> | ||
| 324 : | csouza | 149 | <a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select an item from the list to edit') ?>'); } else {hideMainMenu();submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
| 325 : | root | 1 | <?php echo $image; ?> |
| 326 : | <?php echo $alt; ?> | ||
| 327 : | </a> | ||
| 328 : | </td> | ||
| 329 : | <?php | ||
| 330 : | } | ||
| 331 : | |||
| 332 : | /** | ||
| 333 : | * Writes a common 'edit' button for a template html | ||
| 334 : | * @param string An override for the task | ||
| 335 : | * @param string An override for the alt text | ||
| 336 : | */ | ||
| 337 : | csouza | 149 | function editHtml( $task='edit_source', $alt=null ) { |
| 338 : | if (is_null($alt)) $alt = T_('Edit HTML'); | ||
| 339 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'html.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 340 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'html_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 341 : | ?> | ||
| 342 : | <td> | ||
| 343 : | csouza | 149 | <a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select an item from the list to edit') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
| 344 : | root | 1 | <?php echo $image; ?> |
| 345 : | <?php echo $alt; ?> | ||
| 346 : | </a> | ||
| 347 : | </td> | ||
| 348 : | <?php | ||
| 349 : | } | ||
| 350 : | |||
| 351 : | /** | ||
| 352 : | * Writes a common 'edit' button for a template html. | ||
| 353 : | * Extended version of editHtml() calling hideMainMenu() before submitbutton(). | ||
| 354 : | * @param string An override for the task | ||
| 355 : | * @param string An override for the alt text | ||
| 356 : | */ | ||
| 357 : | csouza | 149 | function editHtmlX( $task='edit_source', $alt=null ) { |
| 358 : | if (is_null($alt)) $alt = T_('Edit HTML'); | ||
| 359 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'html.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 360 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'html_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 361 : | ?> | ||
| 362 : | <td> | ||
| 363 : | csouza | 149 | <a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select an item from the list to edit') ?>'); } else {hideMainMenu();submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
| 364 : | root | 1 | <?php echo $image; ?> |
| 365 : | <?php echo $alt; ?> | ||
| 366 : | </a> | ||
| 367 : | </td> | ||
| 368 : | <?php | ||
| 369 : | } | ||
| 370 : | |||
| 371 : | /** | ||
| 372 : | * Writes a common 'edit' button for a template css | ||
| 373 : | * @param string An override for the task | ||
| 374 : | * @param string An override for the alt text | ||
| 375 : | */ | ||
| 376 : | csouza | 214 | function editCss( $task='edit_css', $alt=null ) { |
| 377 : | csouza | 149 | if (is_null($alt)) $alt = T_('Edit CSS'); |
| 378 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'css.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 379 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'css_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 380 : | ?> | ||
| 381 : | <td> | ||
| 382 : | csouza | 149 | <a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select an item from the list to edit') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
| 383 : | root | 1 | <?php echo $image; ?> |
| 384 : | <?php echo $alt; ?> | ||
| 385 : | </a> | ||
| 386 : | </td> | ||
| 387 : | <?php | ||
| 388 : | } | ||
| 389 : | |||
| 390 : | /** | ||
| 391 : | * Writes a common 'edit' button for a template css. | ||
| 392 : | * Extended version of editCss() calling hideMainMenu() before submitbutton(). | ||
| 393 : | * @param string An override for the task | ||
| 394 : | * @param string An override for the alt text | ||
| 395 : | */ | ||
| 396 : | csouza | 214 | function editCssX( $task='edit_css', $alt=null ) { |
| 397 : | csouza | 149 | if (is_null($alt)) $alt = T_('Edit CSS'); |
| 398 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'css.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 399 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'css_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 400 : | ?> | ||
| 401 : | <td> | ||
| 402 : | csouza | 149 | <a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select an item from the list to edit') ?>'); } else {hideMainMenu();submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
| 403 : | root | 1 | <?php echo $image; ?> |
| 404 : | <?php echo $alt; ?> | ||
| 405 : | </a> | ||
| 406 : | </td> | ||
| 407 : | <?php | ||
| 408 : | } | ||
| 409 : | |||
| 410 : | /** | ||
| 411 : | * Writes a common 'delete' button for a list of records | ||
| 412 : | * @param string Postscript for the 'are you sure' message | ||
| 413 : | * @param string An override for the task | ||
| 414 : | * @param string An override for the alt text | ||
| 415 : | */ | ||
| 416 : | csouza | 149 | function deleteList( $msg='', $task='remove', $alt=null ) { |
| 417 : | if (is_null($alt)) $alt = T_('Delete'); | ||
| 418 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'delete.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 419 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'delete_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 420 : | ?> | ||
| 421 : | <td> | ||
| 422 : | csouza | 149 | <a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please make a selection from the list to delete') ?>'); } else if (confirm('<?php echo T_('Are you sure you want to delete selected items?') ?> <?php echo $msg;?>')){ submitbutton('<?php echo $task;?>');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
| 423 : | root | 1 | <?php echo $image; ?> |
| 424 : | <?php echo $alt; ?> | ||
| 425 : | </a> | ||
| 426 : | </td> | ||
| 427 : | <?php | ||
| 428 : | } | ||
| 429 : | |||
| 430 : | /** | ||
| 431 : | * Writes a common 'delete' button for a list of records. | ||
| 432 : | * Extended version of deleteList() calling hideMainMenu() before submitbutton(). | ||
| 433 : | * @param string Postscript for the 'are you sure' message | ||
| 434 : | * @param string An override for the task | ||
| 435 : | * @param string An override for the alt text | ||
| 436 : | */ | ||
| 437 : | csouza | 149 | function deleteListX( $msg='', $task='remove', $alt=null ) { |
| 438 : | if (is_null($alt)) $alt = T_('Delete'); | ||
| 439 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'delete.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 440 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'delete_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 441 : | ?> | ||
| 442 : | <td> | ||
| 443 : | csouza | 149 | <a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please make a selection from the list to delete') ?>'); } else if (confirm('<?php echo T_('Are you sure you want to delete selected items?') ?> <?php echo $msg;?>')){ hideMainMenu();submitbutton('<?php echo $task;?>');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
| 444 : | root | 1 | <?php echo $image; ?> |
| 445 : | <?php echo $alt; ?> | ||
| 446 : | </a> | ||
| 447 : | </td> | ||
| 448 : | <?php | ||
| 449 : | } | ||
| 450 : | |||
| 451 : | /** | ||
| 452 : | * Write a trash button that will move items to Trash Manager | ||
| 453 : | */ | ||
| 454 : | csouza | 149 | function trash( $task='remove', $alt=null ) { |
| 455 : | if (is_null($alt)) $alt = T_('Trash'); | ||
| 456 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'delete.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 457 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'delete_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 458 : | ?> | ||
| 459 : | <td> | ||
| 460 : | <a class="toolbar" href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> | ||
| 461 : | <?php echo $image; ?> | ||
| 462 : | <?php echo $alt; ?> | ||
| 463 : | </a> | ||
| 464 : | </td> | ||
| 465 : | <?php | ||
| 466 : | } | ||
| 467 : | |||
| 468 : | /** | ||
| 469 : | * Writes a preview button for a given option (opens a popup window) | ||
| 470 : | * @param string The name of the popup file (excluding the file extension) | ||
| 471 : | */ | ||
| 472 : | function preview( $popup='', $updateEditors=false ) { | ||
| 473 : | global $database; | ||
| 474 : | csouza | 149 | $image = mosAdminMenus::ImageCheckAdmin( 'preview.png', '/administrator/images/', NULL, NULL, T_('Preview'), 'preview' ); |
| 475 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'preview_f2.png', '/administrator/images/', NULL, NULL, T_('Preview'), 'preview', 0 ); | ||
| 476 : | root | 1 | |
| 477 : | $sql = "SELECT template FROM #__templates_menu WHERE client_id='0' AND menuid='0'"; | ||
| 478 : | $database->setQuery( $sql ); | ||
| 479 : | $cur_template = $database->loadResult(); | ||
| 480 : | ?> | ||
| 481 : | <td> | ||
| 482 : | <script language="javascript"> | ||
| 483 : | function popup() { | ||
| 484 : | <?php | ||
| 485 : | if ($updateEditors) { | ||
| 486 : | getEditorContents( 'editor1', 'introtext' ); | ||
| 487 : | getEditorContents( 'editor2', 'fulltext' ); | ||
| 488 : | } | ||
| 489 : | ?> | ||
| 490 : | window.open('popups/<?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'); | ||
| 491 : | } | ||
| 492 : | </script> | ||
| 493 : | <a class="toolbar" href="#" onclick="popup();" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('preview','','<?php echo $image2; ?>',1);"> | ||
| 494 : | <?php echo $image; ?> | ||
| 495 : | Preview | ||
| 496 : | </a> | ||
| 497 : | </td> | ||
| 498 : | <?php | ||
| 499 : | } | ||
| 500 : | |||
| 501 : | /** | ||
| 502 : | * Writes a preview button for a given option (opens a popup window) | ||
| 503 : | * @param string The name of the popup file (excluding the file extension for an xml file) | ||
| 504 : | * @param boolean Use the help file in the component directory | ||
| 505 : | */ | ||
| 506 : | function help( $ref, $com=false ) { | ||
| 507 : | global $mosConfig_live_site; | ||
| 508 : | csouza | 149 | $image = mosAdminMenus::ImageCheckAdmin( 'help.png', '/administrator/images/', NULL, NULL, T_('Help'), 'help' ); |
| 509 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'help_f2.png', '/administrator/images/', NULL, NULL, T_('Help'), 'help', 0 ); | ||
| 510 : | root | 1 | $helpUrl = mosGetParam( $GLOBALS, 'mosConfig_helpurl', '' ); |
| 511 : | if ($helpUrl) { | ||
| 512 : | $url = $helpUrl . '/index2.php?option=com_content&task=findkey&pop=1&keyref=' . urlencode( $ref ); | ||
| 513 : | } else { | ||
| 514 : | $url = $mosConfig_live_site . '/help/'; | ||
| 515 : | if ($com) { | ||
| 516 : | $url = $mosConfig_live_site . '/administrator/components/' . $GLOBALS['option'] . '/help/'; | ||
| 517 : | } | ||
| 518 : | if (!eregi( '\.html$', $ref )) { | ||
| 519 : | $ref = $ref . '.xml'; | ||
| 520 : | } | ||
| 521 : | $url .= $ref; | ||
| 522 : | } | ||
| 523 : | ?> | ||
| 524 : | <td> | ||
| 525 : | <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);"> | ||
| 526 : | <?php echo $image; ?> | ||
| 527 : | csouza | 149 | <?php echo T_('Help') ?> |
| 528 : | root | 1 | </a> |
| 529 : | </td> | ||
| 530 : | <?php | ||
| 531 : | } | ||
| 532 : | |||
| 533 : | /** | ||
| 534 : | * Writes a save button for a given option | ||
| 535 : | * Apply operation leads to a save action only (does not leave edit mode) | ||
| 536 : | * @param string An override for the task | ||
| 537 : | * @param string An override for the alt text | ||
| 538 : | */ | ||
| 539 : | csouza | 149 | function apply( $task='apply', $alt=null ) { |
| 540 : | if (is_null($alt)) $alt = T_('Apply'); | ||
| 541 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'apply.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 542 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'apply_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 543 : | ?> | ||
| 544 : | <td> | ||
| 545 : | <a class="toolbar" href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> | ||
| 546 : | <?php echo $image; ?> | ||
| 547 : | <?php echo $alt;?> | ||
| 548 : | </a> | ||
| 549 : | </td> | ||
| 550 : | <?php | ||
| 551 : | } | ||
| 552 : | |||
| 553 : | /** | ||
| 554 : | * Writes a save button for a given option | ||
| 555 : | * Save operation leads to a save and then close action | ||
| 556 : | * @param string An override for the task | ||
| 557 : | * @param string An override for the alt text | ||
| 558 : | */ | ||
| 559 : | csouza | 149 | function save( $task='save', $alt=null ) { |
| 560 : | if (is_null($alt)) $alt = T_('Save'); | ||
| 561 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'save.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 562 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'save_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 563 : | ?> | ||
| 564 : | <td> | ||
| 565 : | <a class="toolbar" href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> | ||
| 566 : | <?php echo $image; ?> | ||
| 567 : | <?php echo $alt;?> | ||
| 568 : | </a> | ||
| 569 : | </td> | ||
| 570 : | <?php | ||
| 571 : | } | ||
| 572 : | |||
| 573 : | /** | ||
| 574 : | * Writes a save button for a given option (NOTE this is being deprecated) | ||
| 575 : | */ | ||
| 576 : | function savenew() { | ||
| 577 : | $image = mosAdminMenus::ImageCheckAdmin( 'save.png', '/administrator/images/', NULL, NULL, 'save', 'save' ); | ||
| 578 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'save_f2.png', '/administrator/images/', NULL, NULL, 'save', 'save', 0 ); | ||
| 579 : | ?> | ||
| 580 : | <td> | ||
| 581 : | <a class="toolbar" href="javascript:submitbutton('savenew');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('save','','<?php echo $image2; ?>',1);"> | ||
| 582 : | <?php echo $image; ?> | ||
| 583 : | Save | ||
| 584 : | </a> | ||
| 585 : | </td> | ||
| 586 : | <?php | ||
| 587 : | } | ||
| 588 : | |||
| 589 : | /** | ||
| 590 : | * Writes a save button for a given option (NOTE this is being deprecated) | ||
| 591 : | */ | ||
| 592 : | function saveedit() { | ||
| 593 : | $image = mosAdminMenus::ImageCheckAdmin( 'save.png', '/administrator/images/', NULL, NULL, 'save', 'save' ); | ||
| 594 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'save_f2.png', '/administrator/images/', NULL, NULL, 'save', 'save', 0 ); | ||
| 595 : | ?> | ||
| 596 : | <td> | ||
| 597 : | <a class="toolbar" href="javascript:submitbutton('saveedit');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('save','','<?php echo $image2; ?>',1);"> | ||
| 598 : | <?php echo $image; ?> | ||
| 599 : | Save | ||
| 600 : | </a> | ||
| 601 : | </td> | ||
| 602 : | <?php | ||
| 603 : | } | ||
| 604 : | |||
| 605 : | /** | ||
| 606 : | * Writes a cancel button and invokes a cancel operation (eg a checkin) | ||
| 607 : | * @param string An override for the task | ||
| 608 : | * @param string An override for the alt text | ||
| 609 : | */ | ||
| 610 : | csouza | 149 | function cancel( $task='cancel', $alt=null ) { |
| 611 : | if (is_null($alt)) $alt = T_('Cancel'); | ||
| 612 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'cancel.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 613 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'cancel_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); | ||
| 614 : | ?> | ||
| 615 : | <td> | ||
| 616 : | <a class="toolbar" href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> | ||
| 617 : | <?php echo $image; ?> | ||
| 618 : | <?php echo $alt;?> | ||
| 619 : | </a> | ||
| 620 : | </td> | ||
| 621 : | <?php | ||
| 622 : | } | ||
| 623 : | |||
| 624 : | /** | ||
| 625 : | * Writes a cancel button that will go back to the previous page without doing | ||
| 626 : | * any other operation | ||
| 627 : | */ | ||
| 628 : | csouza | 149 | function back( $alt=null, $href='' ) { |
| 629 : | if (is_null($alt)) $alt = T_('Back'); | ||
| 630 : | root | 1 | $image = mosAdminMenus::ImageCheckAdmin( 'back.png', '/administrator/images/', NULL, NULL, 'back', 'cancel' ); |
| 631 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'back_f2.png', '/administrator/images/', NULL, NULL, 'back', 'cancel', 0 ); | ||
| 632 : | if ( $href ) { | ||
| 633 : | $link = $href; | ||
| 634 : | } else { | ||
| 635 : | $link = 'javascript:window.history.back();'; | ||
| 636 : | } | ||
| 637 : | ?> | ||
| 638 : | <td> | ||
| 639 : | <a class="toolbar" href="<?php echo $link; ?>" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('cancel','','<?php echo $image2; ?>',1);"> | ||
| 640 : | <?php echo $image; ?> | ||
| 641 : | <?php echo $alt;?> | ||
| 642 : | </a> | ||
| 643 : | </td> | ||
| 644 : | <?php | ||
| 645 : | } | ||
| 646 : | |||
| 647 : | /** | ||
| 648 : | * Write a divider between menu buttons | ||
| 649 : | */ | ||
| 650 : | function divider() { | ||
| 651 : | $image = mosAdminMenus::ImageCheckAdmin( 'menu_divider.png', '/administrator/images/' ); | ||
| 652 : | ?> | ||
| 653 : | <td> | ||
| 654 : | <?php echo $image; ?> | ||
| 655 : | </td> | ||
| 656 : | <?php | ||
| 657 : | } | ||
| 658 : | |||
| 659 : | /** | ||
| 660 : | * Writes a media_manager button | ||
| 661 : | * @param string The sub-drectory to upload the media to | ||
| 662 : | */ | ||
| 663 : | csouza | 149 | function media_manager( $directory = '', $alt=null ) { |
| 664 : | if (is_null($alt)) $alt = T_('Upload'); | ||
| 665 : | root | 1 | global $database; |
| 666 : | $sql = "SELECT template FROM #__templates_menu WHERE client_id='1' AND menuid='0'"; | ||
| 667 : | $database->setQuery( $sql ); | ||
| 668 : | $cur_template = $database->loadResult(); | ||
| 669 : | csouza | 149 | $image = mosAdminMenus::ImageCheckAdmin( 'upload.png', '/administrator/images/', NULL, NULL, T_('Upload Image'), 'uploadPic' ); |
| 670 : | $image2 = mosAdminMenus::ImageCheckAdmin( 'upload_f2.png', '/administrator/images/', NULL, NULL, T_('Upload Image'), 'uploadPic', 0 ); | ||
| 671 : | root | 1 | ?> |
| 672 : | <td> | ||
| 673 : | <a class="toolbar" href="#" onclick="popupWindow('popups/uploadimage.php?directory=<?php echo $directory; ?>&t=<?php echo $cur_template; ?>','win1',250,100,'no');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('uploadPic','','<?php echo $image2; ?>',1);"> | ||
| 674 : | <?php echo $image; ?> | ||
| 675 : | <?php echo $alt;?> | ||
| 676 : | </a> | ||
| 677 : | </td> | ||
| 678 : | <?php | ||
| 679 : | } | ||
| 680 : | |||
| 681 : | /** | ||
| 682 : | * Writes a spacer cell | ||
| 683 : | * @param string The width for the cell | ||
| 684 : | */ | ||
| 685 : | function spacer( $width='' ) | ||
| 686 : | { | ||
| 687 : | if ($width != '') { | ||
| 688 : | ?> | ||
| 689 : | <td width="<?php echo $width;?>"> </td> | ||
| 690 : | <?php | ||
| 691 : | } else { | ||
| 692 : | ?> | ||
| 693 : | <td> </td> | ||
| 694 : | <?php | ||
| 695 : | } | ||
| 696 : | } | ||
| 697 : | |||
| 698 : | /** | ||
| 699 : | * Writes the end of the menu bar table | ||
| 700 : | */ | ||
| 701 : | function endTable() { | ||
| 702 : | ?> | ||
| 703 : | </tr> | ||
| 704 : | </table> | ||
| 705 : | <?php | ||
| 706 : | } | ||
| 707 : | } | ||
| 708 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

