View of /mambo/branches/4.6/administrator/components/com_menus/components/components.menu.html.php
Parent Directory
|
Revision Log
Revision 1756 -
(download)
(annotate)
Thu May 28 06:41:09 2009 UTC (3 years, 11 months ago) by elpie
File size: 4743 byte(s)
Thu May 28 06:41:09 2009 UTC (3 years, 11 months ago) by elpie
File size: 4743 byte(s)
! Added back copyright date & note (which should not be needed, but which is) that copyright notices must be retained.
<?php
/**
* @package Mambo
* @subpackage Menus
* @author Mambo Foundation Inc see README.php
* @copyright (C) 2000 - 2009 Mambo Foundation Inc.
* See COPYRIGHT.php for copyright notices and details.
* @license GNU/GPL Version 2, see LICENSE.php
*
* Redistributions of files must retain the above copyright notice.
*
* Mambo is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*/
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
/**
* Writes the edit form for new and existing content item
*
* A new record is defined when <var>$row</var> is passed with the <var>id</var>
* property set to 0.
*/
class components_menu_html {
function edit( &$menu, &$components, &$lists, &$params, $option ) {
global $mosConfig_live_site;
if ( $menu->id ) {
$title = '[ '. $lists['componentname'] .' ]';
} else {
$title = '';
}
?>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
<script type="text/javascript">
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
var comp_links = new Array;
<?php
foreach ($components as $row) {
?>
comp_links[ <?php echo $row->value;?> ] = 'index.php?<?php echo addslashes( $row->link );?>';
<?php
}
?>
if ( form.id.value == 0 ) {
var comp_id = getSelectedValue( 'adminForm', 'componentid' );
form.link.value = comp_links[comp_id];
} else {
form.link.value = comp_links[form.componentid.value];
}
if ( trim( form.name.value ) == "" ){
alert( "<?php echo T_('Item must have a name'); ?>" );
} else if (form.componentid.value == ""){
alert( "<?php echo T_('Please select a Component'); ?>" );
} else {
submitform( pressbutton );
}
}
</script>
<form action="index2.php" method="post" name="adminForm">
<table class="adminheading">
<tr>
<th>
<?php echo $menu->id ? T_('Edit') : T_('Add');?> <?php printf(T_('Menu Item :: Component <small><small>%s</small></small>'), $title) ?>
</th>
</tr>
</table>
<table width="100%">
<tr valign="top">
<td width="60%">
<table class="adminform">
<tr>
<th colspan="2">
<?php echo T_('Details'); ?>
</th>
</tr>
<tr>
<td width="10%" align="right"><?php echo T_('Name:'); ?></td>
<td width="80%">
<input class="inputbox" type="text" name="name" size="50" maxlength="100" value="<?php echo htmlspecialchars( $menu->name, ENT_QUOTES ); ?>" />
</td>
</tr>
<tr>
<td valign="top" align="right"><?php echo T_('Component:'); ?></td>
<td>
<?php echo $lists['componentid']; ?>
</td>
</tr>
<tr>
<td width="10%" align="right"><?php echo T_('Url:'); ?></td>
<td width="80%">
<?php echo $lists['link']; ?>
</td>
</tr>
<tr>
<td align="right"><?php echo T_('Parent Item:'); ?></td>
<td>
<?php echo $lists['parent'];?>
</td>
</tr>
<tr>
<td valign="top" align="right"><?php echo T_('Ordering:'); ?></td>
<td>
<?php echo $lists['ordering']; ?>
</td>
</tr>
<tr>
<td valign="top" align="right"><?php echo T_('Access Level:'); ?></td>
<td>
<?php echo $lists['access']; ?>
</td>
</tr>
<tr>
<td valign="top" align="right"><?php echo T_('Published:'); ?></td>
<td>
<?php echo $lists['published']; ?>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table>
</td>
<td width="40%">
<table class="adminform">
<tr>
<th>
<?php echo T_('Parameters'); ?>
</th>
</tr>
<tr>
<td>
<?php
if ($menu->id) {
echo $params->render();
} else {
?>
<strong><?php echo T_('Parameter list will be available once you save this New menu item'); ?></strong>
<?php
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="id" value="<?php echo $menu->id; ?>" />
<input type="hidden" name="link" value="" />
<input type="hidden" name="menutype" value="<?php echo $menu->menutype; ?>" />
<input type="hidden" name="type" value="<?php echo $menu->type; ?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="hidemainmenu" value="0" />
</form>
<script src="<?php echo $mosConfig_live_site;?>/includes/js/overlib_mini.js" type="text/javascript"></script>
<?php
}
}
?>| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

