| 1 |
<?php |
<?php |
| 2 |
/** |
/** |
| 3 |
* @version $Id: menubar.html.php,v 1.1 2005/07/22 01:53:54 eddieajau Exp $ |
* @package Mambo Open Source |
| 4 |
* @package Mambo |
* @copyright (C) 2005 - 2006 Mambo Foundation Inc. |
|
* @copyright (C) 2000 - 2005 Miro International Pty Ltd |
|
| 5 |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
| 6 |
|
* |
| 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 |
* Mambo is Free Software |
* Mambo is Free Software |
| 10 |
*/ |
*/ |
| 11 |
|
|
| 12 |
/** |
/** |
| 13 |
* Utility class for the button bar |
* Utility class for the button bar |
|
* @package Mambo |
|
| 14 |
*/ |
*/ |
| 15 |
class mosMenuBar { |
class mosMenuBar { |
| 16 |
|
|
| 39 |
* @param string The alt text for the icon image |
* @param string The alt text for the icon image |
| 40 |
* @param boolean True if required to check that a standard list item is checked |
* @param boolean True if required to check that a standard list item is checked |
| 41 |
*/ |
*/ |
| 42 |
function custom( $task='', $icon='', $iconOver='', $alt='', $listSelect=true ) { |
function custom( $task='', $icon='', $iconOver='', $alt='', $listSelect=true, $prefix='' ) { |
| 43 |
if ($listSelect) { |
if ($listSelect) { |
| 44 |
$href = "javascript:if (document.adminForm.boxchecked.value == 0){ alert('".sprintf(T_('Please make a selection from the list to %s'),$alt)."');}else{submitbutton('$task')}"; |
$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 { |
} else { |
| 46 |
$href = "javascript:submitbutton('$task')"; |
$href = "javascript:".$prefix."submitbutton('$task')"; |
| 47 |
} |
} |
| 48 |
if ($icon && $iconOver) { |
if ($icon && $iconOver) { |
| 49 |
?> |
?> |
| 50 |
<td> |
<td> |
| 51 |
<a class="toolbar" href="<?php echo $href;?>" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','images/<?php echo $iconOver;?>',1);"> |
<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" /> |
<img name="<?php echo $task;?>" src="images/<?php echo $icon;?>" alt="<?php echo $alt;?>" border="0" align="middle" /><br> |
|
|
|
| 53 |
<?php echo $alt; ?></a> |
<?php echo $alt; ?></a> |
| 54 |
</td> |
</td> |
| 55 |
<?php |
<?php |
| 57 |
?> |
?> |
| 58 |
<td> |
<td> |
| 59 |
<a class="toolbar" href="<?php echo $href;?>"> |
<a class="toolbar" href="<?php echo $href;?>"> |
| 60 |
|
<br> |
| 61 |
<?php echo $alt; ?></a> |
<?php echo $alt; ?></a> |
| 62 |
</td> |
</td> |
| 63 |
<?php |
<?php |
| 74 |
* @param boolean True if required to check that a standard list item is checked |
* @param boolean True if required to check that a standard list item is checked |
| 75 |
*/ |
*/ |
| 76 |
function customX( $task='', $icon='', $iconOver='', $alt='', $listSelect=true ) { |
function customX( $task='', $icon='', $iconOver='', $alt='', $listSelect=true ) { |
| 77 |
if ($listSelect) { |
mosMenuBar::custom ($task, $icon, $iconOver, $alt, $listSelect, 'hideMainMenu();'); |
|
$href = "javascript:if (document.adminForm.boxchecked.value == 0){ alert('".sprintf(T_('Please make a selection from the list to %s'), $alt)."');}else{hideMainMenu();submitbutton('$task')}"; |
|
|
} else { |
|
|
$href = "javascript:hideMainMenu();submitbutton('$task')"; |
|
| 78 |
} |
} |
| 79 |
if ($icon && $iconOver) { |
|
| 80 |
|
/** |
| 81 |
|
* Standard routine for displaying toolbar icon |
| 82 |
|
* @param string An override for the task |
| 83 |
|
* @param string An override for the alt text |
| 84 |
|
* @param string The name to be used as a legend and as the image name |
| 85 |
|
* @param |
| 86 |
|
*/ |
| 87 |
|
function addToToolBar ($task, $alt, $name, $imagename, $extended=false, $listprompt='') { |
| 88 |
|
if (is_null($alt)) $alt = Td_('common', $name); |
| 89 |
|
$image = mosAdminMenus::ImageCheckAdmin( $imagename.'.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
| 90 |
|
$image2 = mosAdminMenus::ImageCheckAdmin( $imagename.'_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
| 91 |
?> |
?> |
| 92 |
<td> |
<td> |
| 93 |
<a class="toolbar" href="<?php echo $href;?>" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','images/<?php echo $iconOver;?>',1);"> |
<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);"> |
|
<img name="<?php echo $task;?>" src="images/<?php echo $icon;?>" alt="<?php echo $alt;?>" border="0" align="middle" /> |
|
|
|
|
|
<?php echo $alt; ?></a> |
|
|
</td> |
|
| 94 |
<?php |
<?php |
| 95 |
} else { |
echo $image; |
| 96 |
|
echo '<br>'; |
| 97 |
|
echo $alt; |
| 98 |
?> |
?> |
| 99 |
<td> |
</a> |
|
<a class="toolbar" href="<?php echo $href;?>"> |
|
|
|
|
|
<?php echo $alt; ?></a> |
|
| 100 |
</td> |
</td> |
| 101 |
<?php |
<?php |
| 102 |
} |
} |
| 103 |
|
|
| 104 |
|
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 |
|
|
| 113 |
|
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 |
/** |
/** |
| 123 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 124 |
*/ |
*/ |
| 125 |
function addNew( $task='new', $alt=null ) { |
function addNew( $task='new', $alt=null ) { |
| 126 |
if (is_null($alt)) $alt = T_('New'); |
mosMenuBar::addToToolBar ($task, $alt, 'New', 'new'); |
|
$image = mosAdminMenus::ImageCheckAdmin( 'new.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
|
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'new_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 127 |
} |
} |
| 128 |
|
|
| 129 |
/** |
/** |
| 133 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 134 |
*/ |
*/ |
| 135 |
function addNewX( $task='new', $alt=null ) { |
function addNewX( $task='new', $alt=null ) { |
| 136 |
if (is_null($alt)) $alt = T_('New'); |
mosMenuBar::addToToolBar ($task, $alt, 'New', 'new', true); |
|
$image = mosAdminMenus::ImageCheckAdmin( 'new.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
|
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'new_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:hideMainMenu();submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 137 |
} |
} |
| 138 |
|
|
| 139 |
/** |
/** |
| 142 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 143 |
*/ |
*/ |
| 144 |
function publish( $task='publish', $alt=null ) { |
function publish( $task='publish', $alt=null ) { |
| 145 |
if (is_null($alt)) $alt = T_('Publish'); |
mosMenuBar::addToToolBar ($task, $alt, 'Publish', 'publish'); |
|
$image = mosAdminMenus::ImageCheckAdmin( 'publish.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
|
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'publish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 146 |
} |
} |
| 147 |
|
|
| 148 |
/** |
/** |
| 151 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 152 |
*/ |
*/ |
| 153 |
function publishList( $task='publish', $alt=null ) { |
function publishList( $task='publish', $alt=null ) { |
| 154 |
if (is_null($alt)) $alt = T_('Publish'); |
$listprompt = Td_('common', 'Please make a selection from the list to publish'); |
| 155 |
$image = mosAdminMenus::ImageCheckAdmin( 'publish.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
mosMenuBar::addToToolBar ($task, $alt, 'Publish', 'publish', false, $listprompt); |
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'publish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please make a selection from the list to publish') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 156 |
} |
} |
| 157 |
|
|
| 158 |
/** |
/** |
| 161 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 162 |
*/ |
*/ |
| 163 |
function makeDefault( $task='default', $alt=null ) { |
function makeDefault( $task='default', $alt=null ) { |
| 164 |
if (is_null($alt)) $alt = T_('Default'); |
$listprompt = Td_('common', 'Please select an item to make default'); |
| 165 |
$image = mosAdminMenus::ImageCheckAdmin( 'publish.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
mosMenuBar::addToToolBar ($task, $alt, 'Default', 'publish', false, $listprompt); |
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'publish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select an item to make default') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 166 |
} |
} |
| 167 |
|
|
| 168 |
/** |
/** |
| 171 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 172 |
*/ |
*/ |
| 173 |
function assign( $task='assign', $alt=null ) { |
function assign( $task='assign', $alt=null ) { |
| 174 |
if (is_null($alt)) $alt = T_('Assign'); |
$listprompt = Td_('common', 'Please select an item to assign'); |
| 175 |
$image = mosAdminMenus::ImageCheckAdmin( 'publish.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
mosMenuBar::addToToolBar ($task, $alt, 'Assign', 'publish', false, $listprompt); |
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'publish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select an item to assign') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 176 |
} |
} |
| 177 |
|
|
| 178 |
/** |
/** |
| 181 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 182 |
*/ |
*/ |
| 183 |
function unpublish( $task='unpublish', $alt=null ) { |
function unpublish( $task='unpublish', $alt=null ) { |
| 184 |
if (is_null($alt)) $alt = T_('Unpublish'); |
mosMenuBar::addToToolBar ($task, $alt, 'Unpublish', 'unpublish'); |
|
$image = mosAdminMenus::ImageCheckAdmin( 'unpublish.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
|
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'unpublish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);" > |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 185 |
} |
} |
| 186 |
|
|
| 187 |
/** |
/** |
| 190 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 191 |
*/ |
*/ |
| 192 |
function unpublishList( $task='unpublish', $alt=null ) { |
function unpublishList( $task='unpublish', $alt=null ) { |
| 193 |
if (is_null($alt)) $alt = T_('Unpublish'); |
$listprompt = Td_('common', 'Please make a selection from the list to unpublish'); |
| 194 |
$image = mosAdminMenus::ImageCheckAdmin( 'unpublish.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
mosMenuBar::addToToolBar ($task, $alt, 'Unpublish', 'unpublish', false, $listprompt); |
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'unpublish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please make a selection from the list to unpublish') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);" > |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 195 |
} |
} |
| 196 |
|
|
| 197 |
/** |
/** |
| 200 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 201 |
*/ |
*/ |
| 202 |
function archiveList( $task='archive', $alt=null ) { |
function archiveList( $task='archive', $alt=null ) { |
| 203 |
if (is_null($alt)) $alt = T_('Archive'); |
$listprompt = Td_('common', 'Please make a selection from the list to archive'); |
| 204 |
$image = mosAdminMenus::ImageCheckAdmin( 'archive.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
mosMenuBar::addToToolBar ($task, $alt, 'Archive', 'archive', false, $listprompt); |
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'archive_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please make a selection from the list to archive') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 205 |
} |
} |
| 206 |
|
|
| 207 |
/** |
/** |
| 210 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 211 |
*/ |
*/ |
| 212 |
function unarchiveList( $task='unarchive', $alt=null ) { |
function unarchiveList( $task='unarchive', $alt=null ) { |
| 213 |
if (is_null($alt)) $alt = T_('Unarchive'); |
$listprompt = Td_('common', 'Please select a news story to unarchive'); |
| 214 |
$image = mosAdminMenus::ImageCheckAdmin( 'unarchive.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
mosMenuBar::addToToolBar ($task, $alt, 'Unarchive', 'unarchive', false, $listprompt); |
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'unarchive_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select a news story to unarchive') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 215 |
} |
} |
| 216 |
|
|
| 217 |
/** |
/** |
| 220 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 221 |
*/ |
*/ |
| 222 |
function editList( $task='edit', $alt=null ) { |
function editList( $task='edit', $alt=null ) { |
| 223 |
if (is_null($alt)) $alt = T_('Edit'); |
$listprompt = Td_('common', 'Please select an item from the list to edit'); |
| 224 |
$image = mosAdminMenus::ImageCheckAdmin( 'edit.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
mosMenuBar::addToToolBar ($task, $alt, 'Edit', 'edit', false, $listprompt); |
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'edit_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select an item from the list to edit') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 225 |
} |
} |
| 226 |
|
|
| 227 |
/** |
/** |
| 231 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 232 |
*/ |
*/ |
| 233 |
function editListX( $task='edit', $alt=null ) { |
function editListX( $task='edit', $alt=null ) { |
| 234 |
if (is_null($alt)) $alt = T_('Edit'); |
$listprompt = Td_('common', 'Please select an item from the list to edit'); |
| 235 |
$image = mosAdminMenus::ImageCheckAdmin( 'edit.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
mosMenuBar::addToToolBar ($task, $alt, 'Edit', 'edit', true, $listprompt); |
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'edit_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select an item from the list to edit') ?>'); } else {hideMainMenu();submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 236 |
} |
} |
| 237 |
|
|
| 238 |
/** |
/** |
| 241 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 242 |
*/ |
*/ |
| 243 |
function editHtml( $task='edit_source', $alt=null ) { |
function editHtml( $task='edit_source', $alt=null ) { |
| 244 |
if (is_null($alt)) $alt = T_('Edit HTML'); |
$listprompt = Td_('common', 'Please select an item from the list to edit'); |
| 245 |
$image = mosAdminMenus::ImageCheckAdmin( 'html.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
mosMenuBar::addToToolBar ($task, $alt, 'Edit HTML', 'html', false, $listprompt); |
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'html_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select an item from the list to edit') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 246 |
} |
} |
| 247 |
|
|
| 248 |
/** |
/** |
| 252 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 253 |
*/ |
*/ |
| 254 |
function editHtmlX( $task='edit_source', $alt=null ) { |
function editHtmlX( $task='edit_source', $alt=null ) { |
| 255 |
if (is_null($alt)) $alt = T_('Edit HTML'); |
$listprompt = Td_('common', 'Please select an item from the list to edit'); |
| 256 |
$image = mosAdminMenus::ImageCheckAdmin( 'html.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
mosMenuBar::addToToolBar ($task, $alt, 'Edit HTML', 'html', true, $listprompt); |
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'html_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select an item from the list to edit') ?>'); } else {hideMainMenu();submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 257 |
} |
} |
| 258 |
|
|
| 259 |
/** |
/** |
| 262 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 263 |
*/ |
*/ |
| 264 |
function editCss( $task='edit_css', $alt=null ) { |
function editCss( $task='edit_css', $alt=null ) { |
| 265 |
if (is_null($alt)) $alt = T_('Edit CSS'); |
$listprompt = Td_('common', 'Please select an item from the list to edit'); |
| 266 |
$image = mosAdminMenus::ImageCheckAdmin( 'css.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
mosMenuBar::addToToolBar ($task, $alt, 'Edit CSS', 'css', false, $listprompt); |
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'css_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select an item from the list to edit') ?>'); } else {submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 267 |
} |
} |
| 268 |
|
|
| 269 |
/** |
/** |
| 273 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 274 |
*/ |
*/ |
| 275 |
function editCssX( $task='edit_css', $alt=null ) { |
function editCssX( $task='edit_css', $alt=null ) { |
| 276 |
if (is_null($alt)) $alt = T_('Edit CSS'); |
$listprompt = Td_('common', 'Please select an item from the list to edit'); |
| 277 |
$image = mosAdminMenus::ImageCheckAdmin( 'css.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
mosMenuBar::addToToolBar ($task, $alt, 'Edit CSS', 'css', true, $listprompt); |
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'css_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please select an item from the list to edit') ?>'); } else {hideMainMenu();submitbutton('<?php echo $task;?>', '');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 278 |
} |
} |
| 279 |
|
|
| 280 |
/** |
/** |
| 284 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 285 |
*/ |
*/ |
| 286 |
function deleteList( $msg='', $task='remove', $alt=null ) { |
function deleteList( $msg='', $task='remove', $alt=null ) { |
| 287 |
if (is_null($alt)) $alt = T_('Delete'); |
$listprompt = Td_('common', 'Please make a selection from the list to delete'); |
| 288 |
$image = mosAdminMenus::ImageCheckAdmin( 'delete.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
mosMenuBar::addToToolBar ($task, $alt, 'Delete', 'delete', false, $listprompt); |
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'delete_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please make a selection from the list to delete') ?>'); } else if (confirm('<?php echo T_('Are you sure you want to delete selected items?') ?> <?php echo $msg;?>')){ submitbutton('<?php echo $task;?>');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 289 |
} |
} |
| 290 |
|
|
| 291 |
/** |
/** |
| 296 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 297 |
*/ |
*/ |
| 298 |
function deleteListX( $msg='', $task='remove', $alt=null ) { |
function deleteListX( $msg='', $task='remove', $alt=null ) { |
| 299 |
if (is_null($alt)) $alt = T_('Delete'); |
$listprompt = Td_('common', 'Please make a selection from the list to delete'); |
| 300 |
$image = mosAdminMenus::ImageCheckAdmin( 'delete.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
mosMenuBar::addToToolBar ($task, $alt, 'Delete', 'delete', true, $listprompt); |
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'delete_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php echo T_('Please make a selection from the list to delete') ?>'); } else if (confirm('<?php echo T_('Are you sure you want to delete selected items?') ?> <?php echo $msg;?>')){ hideMainMenu();submitbutton('<?php echo $task;?>');}" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 301 |
} |
} |
| 302 |
|
|
| 303 |
/** |
/** |
| 304 |
* Write a trash button that will move items to Trash Manager |
* Write a trash button that will move items to Trash Manager |
| 305 |
*/ |
*/ |
| 306 |
function trash( $task='remove', $alt=null ) { |
function trash( $task='remove', $alt=null ) { |
| 307 |
if (is_null($alt)) $alt = T_('Trash'); |
mosMenuBar::addToToolBar ($task, $alt, 'Trash', 'delete'); |
|
$image = mosAdminMenus::ImageCheckAdmin( 'delete.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
|
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'delete_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt; ?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 308 |
} |
} |
| 309 |
|
|
| 310 |
/** |
/** |
| 312 |
* @param string The name of the popup file (excluding the file extension) |
* @param string The name of the popup file (excluding the file extension) |
| 313 |
*/ |
*/ |
| 314 |
function preview( $popup='', $updateEditors=false ) { |
function preview( $popup='', $updateEditors=false ) { |
| 315 |
global $database; |
$image = mosAdminMenus::ImageCheckAdmin( 'preview.png', '/administrator/images/', NULL, NULL, Td_('common', 'Preview'), 'preview' ); |
| 316 |
$image = mosAdminMenus::ImageCheckAdmin( 'preview.png', '/administrator/images/', NULL, NULL, T_('Preview'), 'preview' ); |
$image2 = mosAdminMenus::ImageCheckAdmin( 'preview_f2.png', '/administrator/images/', NULL, NULL, Td_('common', 'Preview'), 'preview', 0 ); |
| 317 |
$image2 = mosAdminMenus::ImageCheckAdmin( 'preview_f2.png', '/administrator/images/', NULL, NULL, T_('Preview'), 'preview', 0 ); |
$cur_template = mosMenuBar::getTemplate(); |
|
|
|
|
$sql = "SELECT template FROM #__templates_menu WHERE client_id='0' AND menuid='0'"; |
|
|
$database->setQuery( $sql ); |
|
|
$cur_template = $database->loadResult(); |
|
| 318 |
?> |
?> |
| 319 |
<td> |
<td> |
| 320 |
<script language="javascript"> |
<script language="javascript"> |
| 321 |
function popup() { |
function popup() { |
| 322 |
<?php |
<?php |
| 323 |
if ($updateEditors) { |
if ($popup == 'contentwindow') { |
| 324 |
getEditorContents( 'editor1', 'introtext' ); |
getEditorContents( 'editor1', 'introtext' ); |
| 325 |
getEditorContents( 'editor2', 'fulltext' ); |
getEditorContents( 'editor2', 'fulltext' ); |
| 326 |
} |
} |
| 327 |
|
elseif ($popup == 'modulewindow') getEditorContents( 'editor1', 'content' ); |
| 328 |
?> |
?> |
| 329 |
window.open('popups/<?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'); |
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 |
} |
} |
| 331 |
</script> |
</script> |
| 332 |
<a class="toolbar" href="#" onclick="popup();" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('preview','','<?php echo $image2; ?>',1);"> |
<a class="toolbar" href="#" onclick="popup();" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('preview','','<?php echo $image2; ?>',1);"> |
| 343 |
* @param boolean Use the help file in the component directory |
* @param boolean Use the help file in the component directory |
| 344 |
*/ |
*/ |
| 345 |
function help( $ref, $com=false ) { |
function help( $ref, $com=false ) { |
| 346 |
global $mosConfig_live_site; |
$image = mosAdminMenus::ImageCheckAdmin( 'help.png', '/administrator/images/', NULL, NULL, Td_('common', 'Help'), 'help' ); |
| 347 |
$image = mosAdminMenus::ImageCheckAdmin( 'help.png', '/administrator/images/', NULL, NULL, T_('Help'), 'help' ); |
$image2 = mosAdminMenus::ImageCheckAdmin( 'help_f2.png', '/administrator/images/', NULL, NULL, Td_('common', 'Help'), 'help', 0 ); |
| 348 |
$image2 = mosAdminMenus::ImageCheckAdmin( 'help_f2.png', '/administrator/images/', NULL, NULL, T_('Help'), 'help', 0 ); |
$mosConfig_live_site = mamboCore::get('mosConfig_live_site'); |
| 349 |
$helpUrl = mosGetParam( $GLOBALS, 'mosConfig_helpurl', '' ); |
$rootpath = mamboCore::get('rootPath'); |
| 350 |
|
/*$helpUrl = mosGetParam( $GLOBALS, 'mosConfig_helpurl', '' ); |
| 351 |
if ($helpUrl) { |
if ($helpUrl) { |
| 352 |
$url = $helpUrl . '/index2.php?option=com_content&task=findkey&pop=1&keyref=' . urlencode( $ref ); |
$url = $helpUrl . '/index2.php?option=com_content&task=findkey&pop=1&keyref=' . urlencode( $ref ); |
| 353 |
} else { |
} else {*/ |
| 354 |
$url = $mosConfig_live_site . '/help/'; |
$url = $mosConfig_live_site . '/help/'; |
| 355 |
if ($com) { |
if ($com) { |
| 356 |
$url = $mosConfig_live_site . '/administrator/components/' . $GLOBALS['option'] . '/help/'; |
$url = $mosConfig_live_site . '/administrator/components/' . $GLOBALS['option'] . '/help/'; |
| 357 |
} |
} |
| 358 |
if (!eregi( '\.html$', $ref )) { |
$ref = $ref . '.html'; |
|
$ref = $ref . '.xml'; |
|
|
} |
|
| 359 |
$url .= $ref; |
$url .= $ref; |
| 360 |
} |
|
| 361 |
|
#if (!file_exists($rootpath.'/help/'.$ref)) return false; |
| 362 |
|
|
| 363 |
|
/*}*/ |
| 364 |
|
|
| 365 |
?> |
?> |
| 366 |
<td> |
<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);"> |
<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; ?> |
<?php echo $image . '<br>' . Td_('common', 'Help'); ?> |
|
<?php echo T_('Help') ?> |
|
| 369 |
</a> |
</a> |
| 370 |
</td> |
</td> |
| 371 |
<?php |
<?php |
| 378 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 379 |
*/ |
*/ |
| 380 |
function apply( $task='apply', $alt=null ) { |
function apply( $task='apply', $alt=null ) { |
| 381 |
if (is_null($alt)) $alt = T_('Apply'); |
mosMenuBar::addToToolBar ($task, $alt, 'Apply', 'apply'); |
|
$image = mosAdminMenus::ImageCheckAdmin( 'apply.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
|
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'apply_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt;?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 382 |
} |
} |
| 383 |
|
|
| 384 |
/** |
/** |
| 388 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 389 |
*/ |
*/ |
| 390 |
function save( $task='save', $alt=null ) { |
function save( $task='save', $alt=null ) { |
| 391 |
if (is_null($alt)) $alt = T_('Save'); |
mosMenuBar::addToToolBar ($task, $alt, 'Save', 'save'); |
|
$image = mosAdminMenus::ImageCheckAdmin( 'save.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
|
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'save_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt;?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 392 |
} |
} |
| 393 |
|
|
| 394 |
/** |
/** |
| 429 |
* @param string An override for the alt text |
* @param string An override for the alt text |
| 430 |
*/ |
*/ |
| 431 |
function cancel( $task='cancel', $alt=null ) { |
function cancel( $task='cancel', $alt=null ) { |
| 432 |
if (is_null($alt)) $alt = T_('Cancel'); |
mosMenuBar::addToToolBar ($task, $alt, 'Cancel', 'cancel'); |
|
$image = mosAdminMenus::ImageCheckAdmin( 'cancel.png', '/administrator/images/', NULL, NULL, $alt, $task ); |
|
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'cancel_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 0 ); |
|
|
?> |
|
|
<td> |
|
|
<a class="toolbar" href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);"> |
|
|
<?php echo $image; ?> |
|
|
<?php echo $alt;?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
| 433 |
} |
} |
| 434 |
|
|
| 435 |
/** |
/** |
| 437 |
* any other operation |
* any other operation |
| 438 |
*/ |
*/ |
| 439 |
function back( $alt=null, $href='' ) { |
function back( $alt=null, $href='' ) { |
| 440 |
if (is_null($alt)) $alt = T_('Back'); |
if (is_null($alt)) $alt = Td_('common', 'Back'); |
| 441 |
$image = mosAdminMenus::ImageCheckAdmin( 'back.png', '/administrator/images/', NULL, NULL, 'back', 'cancel' ); |
$image = mosAdminMenus::ImageCheckAdmin( 'back.png', '/administrator/images/', NULL, NULL, 'back', 'cancel' ); |
| 442 |
$image2 = mosAdminMenus::ImageCheckAdmin( 'back_f2.png', '/administrator/images/', NULL, NULL, 'back', 'cancel', 0 ); |
$image2 = mosAdminMenus::ImageCheckAdmin( 'back_f2.png', '/administrator/images/', NULL, NULL, 'back', 'cancel', 0 ); |
| 443 |
if ( $href ) { |
if ( $href ) { |
| 472 |
* @param string The sub-drectory to upload the media to |
* @param string The sub-drectory to upload the media to |
| 473 |
*/ |
*/ |
| 474 |
function media_manager( $directory = '', $alt=null ) { |
function media_manager( $directory = '', $alt=null ) { |
| 475 |
if (is_null($alt)) $alt = T_('Upload'); |
if (is_null($alt)) $alt = Td_('common', 'Upload'); |
| 476 |
global $database; |
$cur_template = mosMenuBar::getTemplate(); |
| 477 |
$sql = "SELECT template FROM #__templates_menu WHERE client_id='1' AND menuid='0'"; |
$image = mosAdminMenus::ImageCheckAdmin( 'upload.png', '/administrator/images/', NULL, NULL, Td_('common', 'Upload Image'), 'uploadPic' ); |
| 478 |
$database->setQuery( $sql ); |
$image2 = mosAdminMenus::ImageCheckAdmin( 'upload_f2.png', '/administrator/images/', NULL, NULL, Td_('common', 'Upload Image'), 'uploadPic', 0 ); |
|
$cur_template = $database->loadResult(); |
|
|
$image = mosAdminMenus::ImageCheckAdmin( 'upload.png', '/administrator/images/', NULL, NULL, T_('Upload Image'), 'uploadPic' ); |
|
|
$image2 = mosAdminMenus::ImageCheckAdmin( 'upload_f2.png', '/administrator/images/', NULL, NULL, T_('Upload Image'), 'uploadPic', 0 ); |
|
| 479 |
?> |
?> |
| 480 |
<td> |
<td> |
| 481 |
<a class="toolbar" href="#" onclick="popupWindow('popups/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);"> |
<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);"> |
| 482 |
<?php echo $image; ?> |
<?php echo $image; ?> |
| 483 |
<?php echo $alt;?> |
<?php echo $alt;?> |
| 484 |
</a> |
</a> |