Annotation of /mambo/branches/4.6/administrator/components/com_menus/components/components.menu.html.php
Parent Directory
|
Revision Log
Revision 3 - (view) (download)
| 1 : | root | 1 | <?php |
| 2 : | /** | ||
| 3 : | * @version $Id: components.menu.html.php,v 1.1 2005/07/22 01:52:50 eddieajau Exp $ | ||
| 4 : | * @package Mambo | ||
| 5 : | * @subpackage Menus | ||
| 6 : | * @copyright (C) 2000 - 2005 Miro International Pty Ltd | ||
| 7 : | * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||
| 8 : | * Mambo is Free Software | ||
| 9 : | */ | ||
| 10 : | |||
| 11 : | /** ensure this file is being included by a parent file */ | ||
| 12 : | defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); | ||
| 13 : | |||
| 14 : | /** | ||
| 15 : | * Writes the edit form for new and existing content item | ||
| 16 : | * | ||
| 17 : | * A new record is defined when <var>$row</var> is passed with the <var>id</var> | ||
| 18 : | * property set to 0. | ||
| 19 : | * @package Mambo | ||
| 20 : | * @subpackage Menus | ||
| 21 : | */ | ||
| 22 : | class components_menu_html { | ||
| 23 : | |||
| 24 : | |||
| 25 : | function edit( &$menu, &$components, &$lists, &$params, $option ) { | ||
| 26 : | global $mosConfig_live_site; | ||
| 27 : | |||
| 28 : | if ( $menu->id ) { | ||
| 29 : | $title = '[ '. $lists['componentname'] .' ]'; | ||
| 30 : | } else { | ||
| 31 : | $title = ''; | ||
| 32 : | } | ||
| 33 : | ?> | ||
| 34 : | <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div> | ||
| 35 : | <script language="javascript" type="text/javascript"> | ||
| 36 : | function submitbutton(pressbutton) { | ||
| 37 : | var form = document.adminForm; | ||
| 38 : | if (pressbutton == 'cancel') { | ||
| 39 : | submitform( pressbutton ); | ||
| 40 : | return; | ||
| 41 : | } | ||
| 42 : | |||
| 43 : | var comp_links = new Array; | ||
| 44 : | <?php | ||
| 45 : | foreach ($components as $row) { | ||
| 46 : | ?> | ||
| 47 : | comp_links[ <?php echo $row->value;?> ] = 'index.php?<?php echo addslashes( $row->link );?>'; | ||
| 48 : | <?php | ||
| 49 : | } | ||
| 50 : | ?> | ||
| 51 : | if ( form.id.value == 0 ) { | ||
| 52 : | var comp_id = getSelectedValue( 'adminForm', 'componentid' ); | ||
| 53 : | form.link.value = comp_links[comp_id]; | ||
| 54 : | } else { | ||
| 55 : | form.link.value = comp_links[form.componentid.value]; | ||
| 56 : | } | ||
| 57 : | |||
| 58 : | if ( trim( form.name.value ) == "" ){ | ||
| 59 : | alert( "Item must have a name" ); | ||
| 60 : | } else if (form.componentid.value == ""){ | ||
| 61 : | alert( "Please select a Component" ); | ||
| 62 : | } else { | ||
| 63 : | submitform( pressbutton ); | ||
| 64 : | } | ||
| 65 : | } | ||
| 66 : | </script> | ||
| 67 : | |||
| 68 : | <form action="index2.php" method="post" name="adminForm"> | ||
| 69 : | |||
| 70 : | <table class="adminheading"> | ||
| 71 : | <tr> | ||
| 72 : | <th> | ||
| 73 : | <?php echo $menu->id ? 'Edit' : 'Add';?> Menu Item :: Component <small><small><?php echo $title; ?></small></small> | ||
| 74 : | </th> | ||
| 75 : | </tr> | ||
| 76 : | </table> | ||
| 77 : | |||
| 78 : | <table width="100%"> | ||
| 79 : | <tr valign="top"> | ||
| 80 : | <td width="60%"> | ||
| 81 : | <table class="adminform"> | ||
| 82 : | <tr> | ||
| 83 : | <th colspan="2"> | ||
| 84 : | Details | ||
| 85 : | </th> | ||
| 86 : | </tr> | ||
| 87 : | <tr> | ||
| 88 : | <td width="10%" align="right">Name:</td> | ||
| 89 : | <td width="80%"> | ||
| 90 : | <input class="inputbox" type="text" name="name" size="50" maxlength="100" value="<?php echo htmlspecialchars( $menu->name, ENT_QUOTES ); ?>" /> | ||
| 91 : | </td> | ||
| 92 : | </tr> | ||
| 93 : | <tr> | ||
| 94 : | <td valign="top" align="right">Component:</td> | ||
| 95 : | <td> | ||
| 96 : | <?php echo $lists['componentid']; ?> | ||
| 97 : | </td> | ||
| 98 : | </tr> | ||
| 99 : | <tr> | ||
| 100 : | <td width="10%" align="right">Url:</td> | ||
| 101 : | <td width="80%"> | ||
| 102 : | <?php echo $lists['link']; ?> | ||
| 103 : | </td> | ||
| 104 : | </tr> | ||
| 105 : | <tr> | ||
| 106 : | <td align="right">Parent Item:</td> | ||
| 107 : | <td> | ||
| 108 : | <?php echo $lists['parent'];?> | ||
| 109 : | </td> | ||
| 110 : | </tr> | ||
| 111 : | |||
| 112 : | <tr> | ||
| 113 : | <td valign="top" align="right">Ordering:</td> | ||
| 114 : | <td> | ||
| 115 : | <?php echo $lists['ordering']; ?> | ||
| 116 : | </td> | ||
| 117 : | </tr> | ||
| 118 : | <tr> | ||
| 119 : | <td valign="top" align="right">Access Level:</td> | ||
| 120 : | <td> | ||
| 121 : | <?php echo $lists['access']; ?> | ||
| 122 : | </td> | ||
| 123 : | </tr> | ||
| 124 : | <tr> | ||
| 125 : | <td valign="top" align="right">Published:</td> | ||
| 126 : | <td> | ||
| 127 : | <?php echo $lists['published']; ?> | ||
| 128 : | </td> | ||
| 129 : | </tr> | ||
| 130 : | <tr> | ||
| 131 : | <td colspan="2"> </td> | ||
| 132 : | </tr> | ||
| 133 : | </table> | ||
| 134 : | </td> | ||
| 135 : | <td width="40%"> | ||
| 136 : | <table class="adminform"> | ||
| 137 : | <tr> | ||
| 138 : | <th> | ||
| 139 : | Parameters | ||
| 140 : | </th> | ||
| 141 : | </tr> | ||
| 142 : | <tr> | ||
| 143 : | <td> | ||
| 144 : | <?php | ||
| 145 : | if ($menu->id) { | ||
| 146 : | echo $params->render(); | ||
| 147 : | } else { | ||
| 148 : | ?> | ||
| 149 : | <strong>Parameter list will be available once you save this New menu item</strong> | ||
| 150 : | <?php | ||
| 151 : | } | ||
| 152 : | ?> | ||
| 153 : | </td> | ||
| 154 : | </tr> | ||
| 155 : | </table> | ||
| 156 : | </td> | ||
| 157 : | </tr> | ||
| 158 : | </table> | ||
| 159 : | |||
| 160 : | <input type="hidden" name="option" value="<?php echo $option;?>" /> | ||
| 161 : | <input type="hidden" name="id" value="<?php echo $menu->id; ?>" /> | ||
| 162 : | <input type="hidden" name="link" value="" /> | ||
| 163 : | <input type="hidden" name="menutype" value="<?php echo $menu->menutype; ?>" /> | ||
| 164 : | <input type="hidden" name="type" value="<?php echo $menu->type; ?>" /> | ||
| 165 : | <input type="hidden" name="task" value="" /> | ||
| 166 : | <input type="hidden" name="hidemainmenu" value="0" /> | ||
| 167 : | </form> | ||
| 168 : | <script language="Javascript" src="<?php echo $mosConfig_live_site;?>/includes/js/overlib_mini.js"></script> | ||
| 169 : | <?php | ||
| 170 : | } | ||
| 171 : | |||
| 172 : | } | ||
| 173 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

