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

