Annotation of /mambo/branches/4.6/administrator/components/com_menumanager/admin.menumanager.html.php
Parent Directory
|
Revision Log
Revision 666 - (view) (download)
| 1 : | root | 1 | <?php |
| 2 : | /** | ||
| 3 : | csouza | 297 | * @package Mambo Open Source |
| 4 : | root | 1 | * @subpackage Menus |
| 5 : | csouza | 297 | * @copyright (C) 2005 - 2006 Mambo Foundation Inc. |
| 6 : | root | 1 | * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
| 7 : | csouza | 297 | * |
| 8 : | * 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 | ||
| 9 : | * that Mambo remained free Open Source software owned and managed by the community. | ||
| 10 : | root | 1 | * Mambo is Free Software |
| 11 : | neilt | 616 | */ |
| 12 : | root | 1 | |
| 13 : | /** ensure this file is being included by a parent file */ | ||
| 14 : | defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); | ||
| 15 : | |||
| 16 : | /** | ||
| 17 : | * HTML class for all menumanager component output | ||
| 18 : | */ | ||
| 19 : | class HTML_menumanager { | ||
| 20 : | /** | ||
| 21 : | * Writes a list of the menumanager items | ||
| 22 : | */ | ||
| 23 : | function show ( $option, $menus, $pageNav ) { | ||
| 24 : | global $mosConfig_live_site; | ||
| 25 : | ?> | ||
| 26 : | <script language="javascript" type="text/javascript"> | ||
| 27 : | function menu_listItemTask( id, task, option ) { | ||
| 28 : | var f = document.adminForm; | ||
| 29 : | cb = eval( 'f.' + id ); | ||
| 30 : | if (cb) { | ||
| 31 : | cb.checked = true; | ||
| 32 : | submitbutton(task); | ||
| 33 : | } | ||
| 34 : | return false; | ||
| 35 : | } | ||
| 36 : | </script> | ||
| 37 : | |||
| 38 : | <form action="index2.php" method="post" name="adminForm"> | ||
| 39 : | <table class="adminheading"> | ||
| 40 : | <tr> | ||
| 41 : | <th class="menus"> | ||
| 42 : | neilt | 616 | <?php echo T_('Menu Manager'); ?> |
| 43 : | root | 1 | </th> |
| 44 : | </tr> | ||
| 45 : | </table> | ||
| 46 : | |||
| 47 : | <table class="adminlist"> | ||
| 48 : | <tr> | ||
| 49 : | <th width="20">#</th> | ||
| 50 : | <th width="20px"> | ||
| 51 : | </th> | ||
| 52 : | <th class="title" nowrap="nowrap"> | ||
| 53 : | neilt | 616 | <?php echo T_('Menu Name'); ?> |
| 54 : | root | 1 | </th> |
| 55 : | <th width="5%" nowrap="nowrap"> | ||
| 56 : | neilt | 616 | <?php echo T_('Menu Items'); ?> |
| 57 : | root | 1 | </th> |
| 58 : | <th width="10%"> | ||
| 59 : | neilt | 616 | <?php echo T_('# Published'); ?> |
| 60 : | root | 1 | </th> |
| 61 : | <th width="15%"> | ||
| 62 : | neilt | 616 | <?php echo T_('# Unpublished'); ?> |
| 63 : | root | 1 | </th> |
| 64 : | <th width="15%"> | ||
| 65 : | neilt | 616 | <?php echo T_('# Trash'); ?> |
| 66 : | root | 1 | </th> |
| 67 : | <th width="15%"> | ||
| 68 : | neilt | 616 | <?php echo T_('# Modules'); ?> |
| 69 : | root | 1 | </th> |
| 70 : | </tr> | ||
| 71 : | <?php | ||
| 72 : | $k = 0; | ||
| 73 : | $i = 0; | ||
| 74 : | $start = 0; | ||
| 75 : | if ($pageNav->limitstart) | ||
| 76 : | $start = $pageNav->limitstart; | ||
| 77 : | $count = count($menus)-$start; | ||
| 78 : | if ($pageNav->limit) | ||
| 79 : | if ($count > $pageNav->limit) | ||
| 80 : | $count = $pageNav->limit; | ||
| 81 : | for ($m = $start; $m < $start+$count; $m++) { | ||
| 82 : | $menu = $menus[$m]; | ||
| 83 : | $link = 'index2.php?option=com_menumanager&task=edit&hidemainmenu=1&menu='. $menu->type; | ||
| 84 : | $linkA = 'index2.php?option=com_menus&menutype='. $menu->type; | ||
| 85 : | ?> | ||
| 86 : | <tr class="<?php echo "row". $k; ?>"> | ||
| 87 : | <td align="center" width="30px"> | ||
| 88 : | <?php echo $i + 1 + $pageNav->limitstart;?> | ||
| 89 : | </td> | ||
| 90 : | <td width="30px" align="center"> | ||
| 91 : | <input type="radio" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $menu->type; ?>" onclick="isChecked(this.checked);" /> | ||
| 92 : | </td> | ||
| 93 : | <td> | ||
| 94 : | neilt | 616 | <a href="<?php echo $link; ?>" title="<?php echo T_('Edit Menu Name'); ?>"> |
| 95 : | root | 1 | <?php echo $menu->type; ?> |
| 96 : | </a> | ||
| 97 : | </td> | ||
| 98 : | <td align="center"> | ||
| 99 : | neilt | 616 | <a href="<?php echo $linkA; ?>" title="<?php echo T_('Edit Menu Items'); ?>"> |
| 100 : | root | 1 | <img src="<?php echo $mosConfig_live_site; ?>/includes/js/ThemeOffice/mainmenu.png" border="0"/> |
| 101 : | </a> | ||
| 102 : | </td> | ||
| 103 : | <td align="center"> | ||
| 104 : | <?php | ||
| 105 : | echo $menu->published; | ||
| 106 : | ?> | ||
| 107 : | </td> | ||
| 108 : | <td align="center"> | ||
| 109 : | <?php | ||
| 110 : | echo $menu->unpublished; | ||
| 111 : | ?> | ||
| 112 : | </td> | ||
| 113 : | <td align="center"> | ||
| 114 : | <?php | ||
| 115 : | echo $menu->trash; | ||
| 116 : | ?> | ||
| 117 : | </td> | ||
| 118 : | <td align="center"> | ||
| 119 : | <?php | ||
| 120 : | echo $menu->modules; | ||
| 121 : | ?> | ||
| 122 : | </td> | ||
| 123 : | </tr> | ||
| 124 : | <?php | ||
| 125 : | $k = 1 - $k; | ||
| 126 : | $i++; | ||
| 127 : | } | ||
| 128 : | ?> | ||
| 129 : | </table> | ||
| 130 : | <?php echo $pageNav->getListFooter(); ?> | ||
| 131 : | |||
| 132 : | <input type="hidden" name="option" value="<?php echo $option; ?>" /> | ||
| 133 : | <input type="hidden" name="task" value="" /> | ||
| 134 : | <input type="hidden" name="boxchecked" value="0" /> | ||
| 135 : | <input type="hidden" name="hidemainmenu" value="0" /> | ||
| 136 : | </form> | ||
| 137 : | <?php | ||
| 138 : | } | ||
| 139 : | |||
| 140 : | |||
| 141 : | /** | ||
| 142 : | * writes a form to take the name of the menu you would like created | ||
| 143 : | * @param option display options for the form | ||
| 144 : | */ | ||
| 145 : | function edit ( &$row, $option ) { | ||
| 146 : | global $mosConfig_live_site; | ||
| 147 : | |||
| 148 : | $new = $row->menutype ? 0 : 1; | ||
| 149 : | ?> | ||
| 150 : | <script language="javascript" type="text/javascript"> | ||
| 151 : | function submitbutton(pressbutton) { | ||
| 152 : | var form = document.adminForm; | ||
| 153 : | |||
| 154 : | if (pressbutton == 'savemenu') { | ||
| 155 : | if ( form.menutype.value == '' ) { | ||
| 156 : | neilt | 616 | alert( '<?php echo T_('Please enter a menu name'); ?>' ); |
| 157 : | root | 1 | form.menutype.focus(); |
| 158 : | return; | ||
| 159 : | } | ||
| 160 : | <?php | ||
| 161 : | if ( $new ) { | ||
| 162 : | ?> | ||
| 163 : | if ( form.title.value == '' ) { | ||
| 164 : | neilt | 616 | alert( '<?php echo T_('Please enter a module name for your menu'); ?>' ); |
| 165 : | root | 1 | form.title.focus(); |
| 166 : | return; | ||
| 167 : | } | ||
| 168 : | <?php | ||
| 169 : | } | ||
| 170 : | ?> | ||
| 171 : | submitform( 'savemenu' ); | ||
| 172 : | } else { | ||
| 173 : | submitform( pressbutton ); | ||
| 174 : | } | ||
| 175 : | } | ||
| 176 : | </script> | ||
| 177 : | <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div> | ||
| 178 : | <form action="index2.php" method="post" name="adminForm"> | ||
| 179 : | <table class="adminheading"> | ||
| 180 : | <tr> | ||
| 181 : | <th class="menus"> | ||
| 182 : | neilt | 616 | <?php echo T_('Menu Details'); ?> |
| 183 : | root | 1 | </th> |
| 184 : | </tr> | ||
| 185 : | </table> | ||
| 186 : | |||
| 187 : | <table class="adminform"> | ||
| 188 : | <tr height="45px;"> | ||
| 189 : | <td width="100px" align="left"> | ||
| 190 : | neilt | 616 | <strong><?php echo T_('Menu Name:'); ?></strong> |
| 191 : | root | 1 | </td> |
| 192 : | <td> | ||
| 193 : | <input class="inputbox" type="text" name="menutype" size="30" value="<?php echo isset( $row->menutype ) ? $row->menutype : ''; ?>" /> | ||
| 194 : | <?php | ||
| 195 : | csouza | 165 | $tip = T_('This is the identification name used by mambo to identify this menu within the code - it must be unique. It is recommended that you do not have any spaces in your Menu Name'); |
| 196 : | root | 1 | echo mosToolTip( $tip ); |
| 197 : | ?> | ||
| 198 : | </td> | ||
| 199 : | </tr> | ||
| 200 : | <?php | ||
| 201 : | if ( $new ) { | ||
| 202 : | ?> | ||
| 203 : | <tr> | ||
| 204 : | <td width="100px" align="left" valign="top"> | ||
| 205 : | ninekrit | 666 | <strong><?php echo T_('Module Title:'); ?></strong> |
| 206 : | root | 1 | </td> |
| 207 : | <td> | ||
| 208 : | <input class="inputbox" type="text" name="title" size="30" value="<?php echo $row->title ? $row->title : '';?>" /> | ||
| 209 : | <?php | ||
| 210 : | csouza | 165 | $tip = T_('Title of the mod_mainmenu module required to show this Menu'); |
| 211 : | root | 1 | echo mosToolTip( $tip ); |
| 212 : | ?> | ||
| 213 : | <br/><br/><br/> | ||
| 214 : | <strong> | ||
| 215 : | neilt | 616 | |
| 216 : | * <?php echo T_('A new mod_mainmenu module, with the Title you have entered above will automatically be created when you save this menu.'); ?> * | ||
| 217 : | root | 1 | <br/><br/> |
| 218 : | neilt | 616 | <?php echo T_('Parameters for the module created are to be edited through the "Modules Manager [site]": Modules -> Site Modules'); ?> |
| 219 : | root | 1 | </strong> |
| 220 : | </td> | ||
| 221 : | </tr> | ||
| 222 : | <?php | ||
| 223 : | } | ||
| 224 : | ?> | ||
| 225 : | <tr> | ||
| 226 : | <td colspan="2"> | ||
| 227 : | </td> | ||
| 228 : | </tr> | ||
| 229 : | </table> | ||
| 230 : | <br /><br /> | ||
| 231 : | |||
| 232 : | <script language="Javascript" src="<?php echo $mosConfig_live_site; ?>/includes/js/overlib_mini.js"></script> | ||
| 233 : | <?php | ||
| 234 : | if ( $new ) { | ||
| 235 : | ?> | ||
| 236 : | <input type="hidden" name="id" value="<?php echo $row->id; ?>" /> | ||
| 237 : | <input type="hidden" name="iscore" value="<?php echo $row->iscore; ?>" /> | ||
| 238 : | <input type="hidden" name="published" value="<?php echo $row->published; ?>" /> | ||
| 239 : | <input type="hidden" name="position" value="<?php echo $row->position; ?>" /> | ||
| 240 : | <input type="hidden" name="module" value="mod_mainmenu" /> | ||
| 241 : | <input type="hidden" name="params" value="<?php echo $row->params; ?>" /> | ||
| 242 : | <?php | ||
| 243 : | } | ||
| 244 : | ?> | ||
| 245 : | |||
| 246 : | <input type="hidden" name="new" value="<?php echo $new; ?>" /> | ||
| 247 : | <input type="hidden" name="old_menutype" value="<?php echo $row->menutype; ?>" /> | ||
| 248 : | <input type="hidden" name="option" value="<?php echo $option; ?>" /> | ||
| 249 : | <input type="hidden" name="task" value="savemenu" /> | ||
| 250 : | <input type="hidden" name="boxchecked" value="0" /> | ||
| 251 : | </form> | ||
| 252 : | <?php | ||
| 253 : | } | ||
| 254 : | |||
| 255 : | |||
| 256 : | /** | ||
| 257 : | * A delete confirmation page | ||
| 258 : | * Writes list of the items that have been selected for deletion | ||
| 259 : | */ | ||
| 260 : | function showDelete( $option, $type, $items, $modules ) { | ||
| 261 : | ?> | ||
| 262 : | <form action="index2.php" method="post" name="adminForm"> | ||
| 263 : | <table class="adminheading"> | ||
| 264 : | <tr> | ||
| 265 : | <th> | ||
| 266 : | neilt | 616 | <?php printf(T_('Delete Menu: %s'), $type) ?> |
| 267 : | root | 1 | </th> |
| 268 : | </tr> | ||
| 269 : | </table> | ||
| 270 : | |||
| 271 : | <br /> | ||
| 272 : | <table class="adminform"> | ||
| 273 : | <tr> | ||
| 274 : | <td width="3%"></td> | ||
| 275 : | <td align="left" valign="top" width="20%"> | ||
| 276 : | <?php | ||
| 277 : | if ( $modules ) { | ||
| 278 : | ?> | ||
| 279 : | neilt | 616 | <strong><?php echo T_('Module(s) being Deleted:'); ?></strong> |
| 280 : | root | 1 | <ol> |
| 281 : | <?php | ||
| 282 : | foreach ( $modules as $module ) { | ||
| 283 : | ?> | ||
| 284 : | <li> | ||
| 285 : | <font color="#000066"> | ||
| 286 : | <strong> | ||
| 287 : | <?php echo $module->title; ?> | ||
| 288 : | </strong> | ||
| 289 : | </font> | ||
| 290 : | </li> | ||
| 291 : | <input type="hidden" name="cid[]" value="<?php echo $module->id; ?>" /> | ||
| 292 : | <?php | ||
| 293 : | } | ||
| 294 : | ?> | ||
| 295 : | </ol> | ||
| 296 : | <?php | ||
| 297 : | } | ||
| 298 : | ?> | ||
| 299 : | </td> | ||
| 300 : | <td align="left" valign="top" width="25%"> | ||
| 301 : | neilt | 616 | <strong><?php echo T_('Menu Items being Deleted:'); ?></strong> |
| 302 : | root | 1 | <br /> |
| 303 : | <ol> | ||
| 304 : | <?php | ||
| 305 : | adi | 363 | if (is_array($items)) { |
| 306 : | root | 1 | foreach ( $items as $item ) { |
| 307 : | ?> | ||
| 308 : | <li> | ||
| 309 : | <font color="#000066"> | ||
| 310 : | <?php echo $item->name; ?> | ||
| 311 : | </font> | ||
| 312 : | </li> | ||
| 313 : | <input type="hidden" name="mids[]" value="<?php echo $item->id; ?>" /> | ||
| 314 : | <?php | ||
| 315 : | } | ||
| 316 : | adi | 363 | } |
| 317 : | root | 1 | ?> |
| 318 : | </ol> | ||
| 319 : | </td> | ||
| 320 : | <td> | ||
| 321 : | neilt | 616 | * <?php echo T_('This will <span style="font-weight:bold;color:#FF0000">Delete</span> this Menu, <br />ALL its Menu Items and the Module(s) associated with it'); ?> * |
| 322 : | root | 1 | <br /><br /><br /> |
| 323 : | <div style="border: 1px dotted gray; width: 70px; padding: 10px; margin-left: 100px;"> | ||
| 324 : | neilt | 616 | <a class="toolbar" href="javascript:if (confirm('<?php echo T_('Are you sure you want to Delete this menu? \nThis will Delete the Menu, its Items and the Module(s).'); ?>')){ submitbutton('deletemenu');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('remove','','images/delete_f2.png',1);"> |
| 325 : | <img name="remove" src="images/delete.png" alt="<?php echo T_('Delete'); ?>" border="0" align="middle" /> | ||
| 326 : | <?php echo T_('Delete'); ?> | ||
| 327 : | root | 1 | </a> |
| 328 : | </div> | ||
| 329 : | </td> | ||
| 330 : | </tr> | ||
| 331 : | <tr> | ||
| 332 : | <td> </td> | ||
| 333 : | </tr> | ||
| 334 : | </table> | ||
| 335 : | <br /><br /> | ||
| 336 : | |||
| 337 : | <input type="hidden" name="option" value="<?php echo $option;?>" /> | ||
| 338 : | <input type="hidden" name="task" value="" /> | ||
| 339 : | <input type="hidden" name="type" value="<?php echo $type; ?>" /> | ||
| 340 : | <input type="hidden" name="boxchecked" value="1" /> | ||
| 341 : | </form> | ||
| 342 : | <?php | ||
| 343 : | } | ||
| 344 : | |||
| 345 : | |||
| 346 : | /** | ||
| 347 : | * A copy confirmation page | ||
| 348 : | * Writes list of the items that have been selected for copy | ||
| 349 : | */ | ||
| 350 : | function showCopy( $option, $type, $items ) { | ||
| 351 : | ?> | ||
| 352 : | <script language="javascript" type="text/javascript"> | ||
| 353 : | function submitbutton(pressbutton) { | ||
| 354 : | if (pressbutton == 'copymenu') { | ||
| 355 : | if ( document.adminForm.menu_name.value == '' ) { | ||
| 356 : | neilt | 616 | alert( '<?php echo T_('Please enter a name for the copy of the Menu'); ?>' ); |
| 357 : | root | 1 | return; |
| 358 : | } else if ( document.adminForm.module_name.value == '' ) { | ||
| 359 : | neilt | 616 | alert( '<?php echo T_('Please enter a name for the new Module'); ?>' ); |
| 360 : | root | 1 | return; |
| 361 : | } else { | ||
| 362 : | submitform( 'copymenu' ); | ||
| 363 : | } | ||
| 364 : | } else { | ||
| 365 : | submitform( pressbutton ); | ||
| 366 : | } | ||
| 367 : | } | ||
| 368 : | </script> | ||
| 369 : | <form action="index2.php" method="post" name="adminForm"> | ||
| 370 : | <table class="adminheading"> | ||
| 371 : | <tr> | ||
| 372 : | <th> | ||
| 373 : | neilt | 616 | <?php echo T_('Copy Menu'); ?> |
| 374 : | root | 1 | </th> |
| 375 : | </tr> | ||
| 376 : | </table> | ||
| 377 : | |||
| 378 : | <br /> | ||
| 379 : | <table class="adminform"> | ||
| 380 : | <tr> | ||
| 381 : | <td width="3%"></td> | ||
| 382 : | <td align="left" valign="top" width="30%"> | ||
| 383 : | neilt | 616 | <strong><?php echo T_('New Menu Name:'); ?></strong> |
| 384 : | root | 1 | <br /> |
| 385 : | <input class="inputbox" type="text" name="menu_name" size="30" value="" /> | ||
| 386 : | <br /><br /><br /> | ||
| 387 : | neilt | 616 | <strong><?php echo T_('New Module Name:'); ?></strong> |
| 388 : | root | 1 | <br /> |
| 389 : | <input class="inputbox" type="text" name="module_name" size="30" value="" /> | ||
| 390 : | <br /><br /> | ||
| 391 : | </td> | ||
| 392 : | <td align="left" valign="top" width="25%"> | ||
| 393 : | <strong> | ||
| 394 : | neilt | 616 | <?php echo T_('Menu being copied:'); ?> |
| 395 : | root | 1 | </strong> |
| 396 : | <br /> | ||
| 397 : | <font color="#000066"> | ||
| 398 : | <strong> | ||
| 399 : | <?php echo $type; ?> | ||
| 400 : | </strong> | ||
| 401 : | </font> | ||
| 402 : | <br /><br /> | ||
| 403 : | <strong> | ||
| 404 : | neilt | 616 | <?php echo T_('Menu Items being copied:'); ?> |
| 405 : | root | 1 | </strong> |
| 406 : | <br /> | ||
| 407 : | <ol> | ||
| 408 : | <?php | ||
| 409 : | foreach ( $items as $item ) { | ||
| 410 : | ?> | ||
| 411 : | <li> | ||
| 412 : | <font color="#000066"> | ||
| 413 : | <?php echo $item->name; ?> | ||
| 414 : | </font> | ||
| 415 : | </li> | ||
| 416 : | <input type="hidden" name="mids[]" value="<?php echo $item->id; ?>" /> | ||
| 417 : | <?php | ||
| 418 : | } | ||
| 419 : | ?> | ||
| 420 : | </ol> | ||
| 421 : | </td> | ||
| 422 : | <td valign="top"> | ||
| 423 : | </td> | ||
| 424 : | </tr> | ||
| 425 : | <tr> | ||
| 426 : | <td> </td> | ||
| 427 : | </tr> | ||
| 428 : | </table> | ||
| 429 : | <br /><br /> | ||
| 430 : | |||
| 431 : | <input type="hidden" name="option" value="<?php echo $option;?>" /> | ||
| 432 : | <input type="hidden" name="task" value="" /> | ||
| 433 : | <input type="hidden" name="type" value="<?php echo $type; ?>" /> | ||
| 434 : | </form> | ||
| 435 : | <?php | ||
| 436 : | } | ||
| 437 : | } | ||
| 438 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

