View of /mambo/branches/4.6/administrator/components/com_menumanager/admin.menumanager.html.php
Parent Directory
|
Revision Log
Revision 1756 -
(download)
(annotate)
Thu May 28 06:41:09 2009 UTC (4 years ago) by elpie
File size: 11710 byte(s)
Thu May 28 06:41:09 2009 UTC (4 years ago) by elpie
File size: 11710 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.' );
/**
* HTML class for all menumanager component output
*/
class HTML_menumanager {
/**
* Writes a list of the menumanager items
*/
function show ( $option, $menus, $pageNav ) {
global $mosConfig_live_site;
?>
<script type="text/javascript">
function menu_listItemTask( id, task, option ) {
var f = document.adminForm;
cb = eval( 'f.' + id );
if (cb) {
cb.checked = true;
submitbutton(task);
}
return false;
}
</script>
<form action="index2.php" method="post" name="adminForm">
<table class="adminheading">
<tr>
<th class="menus">
<?php echo T_('Menu Manager'); ?>
</th>
</tr>
</table>
<table class="adminlist">
<tr>
<th width="20">#</th>
<th width="20px">
</th>
<th class="title" nowrap="nowrap">
<?php echo T_('Menu Name'); ?>
</th>
<th width="5%" nowrap="nowrap">
<?php echo T_('Menu Items'); ?>
</th>
<th width="10%">
<?php echo T_('# Published'); ?>
</th>
<th width="15%">
<?php echo T_('# Unpublished'); ?>
</th>
<th width="15%">
<?php echo T_('# Trash'); ?>
</th>
<th width="15%">
<?php echo T_('# Modules'); ?>
</th>
</tr>
<?php
$k = 0;
$i = 0;
$start = 0;
if ($pageNav->limitstart)
$start = $pageNav->limitstart;
$count = count($menus)-$start;
if ($pageNav->limit)
if ($count > $pageNav->limit)
$count = $pageNav->limit;
for ($m = $start; $m < $start+$count; $m++) {
$menu = $menus[$m];
$link = 'index2.php?option=com_menumanager&task=edit&hidemainmenu=1&menu='. $menu->type;
$linkA = 'index2.php?option=com_menus&menutype='. $menu->type;
?>
<tr class="<?php echo "row". $k; ?>">
<td align="center" width="30px">
<?php echo $i + 1 + $pageNav->limitstart;?>
</td>
<td width="30px" align="center">
<input type="checkbox" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $menu->type; ?>" onclick="isChecked(this.checked);" />
</td>
<td>
<a href="<?php echo $link; ?>" title="<?php echo T_('Edit Menu Name'); ?>">
<?php echo $menu->type; ?>
</a>
</td>
<td align="center">
<a href="<?php echo $linkA; ?>" title="<?php echo T_('Edit Menu Items'); ?>">
<img src="<?php echo $mosConfig_live_site; ?>/includes/js/ThemeOffice/mainmenu.png" border="0"/>
</a>
</td>
<td align="center">
<?php
echo $menu->published;
?>
</td>
<td align="center">
<?php
echo $menu->unpublished;
?>
</td>
<td align="center">
<?php
echo $menu->trash;
?>
</td>
<td align="center">
<?php
echo $menu->modules;
?>
</td>
</tr>
<?php
$k = 1 - $k;
$i++;
}
?>
</table>
<?php echo $pageNav->getListFooter(); ?>
<input type="hidden" name="option" value="<?php echo $option; ?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="hidemainmenu" value="0" />
</form>
<?php
}
/**
* writes a form to take the name of the menu you would like created
* @param option display options for the form
*/
function edit ( &$row, $option ) {
global $mosConfig_live_site;
$new = $row->menutype ? 0 : 1;
?>
<script type="text/javascript">
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'savemenu') {
if ( form.menutype.value == '' ) {
alert( '<?php echo T_('Please enter a menu name'); ?>' );
form.menutype.focus();
return;
}
<?php
if ( $new ) {
?>
if ( form.title.value == '' ) {
alert( '<?php echo T_('Please enter a module name for your menu'); ?>' );
form.title.focus();
return;
}
<?php
}
?>
submitform( 'savemenu' );
} else {
submitform( pressbutton );
}
}
</script>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
<form action="index2.php" method="post" name="adminForm">
<table class="adminheading">
<tr>
<th class="menus">
<?php echo T_('Menu Details'); ?>
</th>
</tr>
</table>
<table class="adminform">
<tr height="45px;">
<td width="100px" align="left">
<strong><?php echo T_('Menu Name:'); ?></strong>
</td>
<td>
<input class="inputbox" type="text" name="menutype" size="30" value="<?php echo isset( $row->menutype ) ? $row->menutype : ''; ?>" />
<?php
$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');
echo mosToolTip( $tip );
?>
</td>
</tr>
<?php
if ( $new ) {
?>
<tr>
<td width="100px" align="left" valign="top">
<strong><?php echo T_('Module Title:'); ?></strong>
</td>
<td>
<input class="inputbox" type="text" name="title" size="30" value="<?php echo $row->title ? $row->title : '';?>" />
<?php
$tip = T_('Title of the mod_mainmenu module required to show this Menu');
echo mosToolTip( $tip );
?>
<br /><br /><br />
<strong>
* <?php echo T_('A new mod_mainmenu module, with the Title you have entered above will automatically be created when you save this menu.'); ?> *
<br /><br />
<?php echo T_('Parameters for the module created are to be edited through the "Modules Manager [site]": Modules -> Site Modules'); ?>
</strong>
</td>
</tr>
<?php
}
?>
<tr>
<td colspan="2">
</td>
</tr>
</table>
<br /><br />
<script src="<?php echo $mosConfig_live_site; ?>/includes/js/overlib_mini.js" type="text/javascript"></script>
<?php
if ( $new ) {
?>
<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
<input type="hidden" name="iscore" value="<?php echo $row->iscore; ?>" />
<input type="hidden" name="published" value="<?php echo $row->published; ?>" />
<input type="hidden" name="position" value="<?php echo $row->position; ?>" />
<input type="hidden" name="module" value="mod_mainmenu" />
<input type="hidden" name="params" value="<?php echo $row->params; ?>" />
<?php
}
?>
<input type="hidden" name="new" value="<?php echo $new; ?>" />
<input type="hidden" name="old_menutype" value="<?php echo $row->menutype; ?>" />
<input type="hidden" name="option" value="<?php echo $option; ?>" />
<input type="hidden" name="task" value="savemenu" />
<input type="hidden" name="boxchecked" value="0" />
</form>
<?php
}
/**
* A delete confirmation page
* Writes list of the items that have been selected for deletion
*/
function showDelete( $option, $type, $items, $modules ) {
?>
<form action="index2.php" method="post" name="adminForm">
<table class="adminheading">
<tr>
<th>
<?php printf(T_('Delete Menu: %s'), $type) ?>
</th>
</tr>
</table>
<br />
<table class="adminform">
<tr>
<td width="3%"></td>
<td align="left" valign="top" width="20%">
<?php
if ( $modules ) {
?>
<strong><?php echo T_('Module(s) being Deleted:'); ?></strong>
<ol>
<?php
foreach ( $modules as $module ) {
?>
<li>
<font color="#000066">
<strong>
<?php echo $module->title; ?>
</strong>
</font>
</li>
<input type="hidden" name="cid[]" value="<?php echo $module->id; ?>" />
<?php
}
?>
</ol>
<?php
}
?>
</td>
<td align="left" valign="top" width="25%">
<strong><?php echo T_('Menu Items being Deleted:'); ?></strong>
<br />
<ol>
<?php
if (is_array($items)) {
foreach ( $items as $item ) {
?>
<li>
<font color="#000066">
<?php echo $item->name; ?>
</font>
</li>
<input type="hidden" name="mids[]" value="<?php echo $item->id; ?>" />
<?php
}
}
?>
</ol>
</td>
<td>
* <?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'); ?> *
<br /><br /><br />
<div style="border: 1px dotted gray; width: 70px; padding: 10px; margin-left: 100px;">
<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);">
<img name="remove" src="images/delete.png" alt="<?php echo T_('Delete'); ?>" border="0" align="middle" />
<?php echo T_('Delete'); ?>
</a>
</div>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<br /><br />
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="type" value="<?php echo $type; ?>" />
<input type="hidden" name="boxchecked" value="1" />
</form>
<?php
}
/**
* A copy confirmation page
* Writes list of the items that have been selected for copy
*/
function showCopy( $option, $type, $items ) {
?>
<script type="text/javascript">
function submitbutton(pressbutton) {
if (pressbutton == 'copymenu') {
if ( document.adminForm.menu_name.value == '' ) {
alert( '<?php echo T_('Please enter a name for the copy of the Menu'); ?>' );
return;
} else if ( document.adminForm.module_name.value == '' ) {
alert( '<?php echo T_('Please enter a name for the new Module'); ?>' );
return;
} else {
submitform( 'copymenu' );
}
} else {
submitform( pressbutton );
}
}
</script>
<form action="index2.php" method="post" name="adminForm">
<table class="adminheading">
<tr>
<th>
<?php echo T_('Copy Menu'); ?>
</th>
</tr>
</table>
<br />
<table class="adminform">
<tr>
<td width="3%"></td>
<td align="left" valign="top" width="30%">
<strong><?php echo T_('New Menu Name:'); ?></strong>
<br />
<input class="inputbox" type="text" name="menu_name" size="30" value="" />
<br /><br /><br />
<strong><?php echo T_('New Module Name:'); ?></strong>
<br />
<input class="inputbox" type="text" name="module_name" size="30" value="" />
<br /><br />
</td>
<td align="left" valign="top" width="25%">
<strong>
<?php echo T_('Menu being copied:'); ?>
</strong>
<br />
<font color="#000066">
<strong>
<?php echo $type; ?>
</strong>
</font>
<br /><br />
<strong>
<?php echo T_('Menu Items being copied:'); ?>
</strong>
<br />
<ol>
<?php
foreach ( $items as $item ) {
?>
<li>
<font color="#000066">
<?php echo $item->name; ?>
</font>
</li>
<input type="hidden" name="mids[]" value="<?php echo $item->id; ?>" />
<?php
}
?>
</ol>
</td>
<td valign="top">
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<br /><br />
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="type" value="<?php echo $type; ?>" />
</form>
<?php
}
}
?>| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

