00001 <?php
00002
00009 defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
00010
00011 $mainframe = mosMainFrame::getInstance();
00012 require_once ($mainframe->getCfg('absolute_path').'/includes/mambofunc.php');
00013
00014 class mosAdminMenus {
00018 public static function Ordering( &$row, $id ) {
00019 if ( $id ) {
00020 $order = mosAdminMenus::mosGetOrderingList( $row, "SELECT ordering AS value, name AS text"
00021 . "\n FROM #__menu"
00022 . "\n WHERE menutype='". $row->menutype ."'"
00023 . "\n AND parent='". $row->parent ."'"
00024 . "\n AND published != '-2'"
00025 . "\n ORDER BY ordering"
00026 );
00027 $ordering = mosHTML::selectList( $order, 'ordering', 'class="inputbox" size="1"', 'value', 'text', intval( $row->ordering ) );
00028 } else {
00029 $ordering = '<input type="hidden" name="ordering" value="'. $row->ordering .'" />'. T_('New items default to the last place. Ordering can be changed after this item is saved.');
00030 }
00031 return $ordering;
00032 }
00033
00037 public static function Access( &$row ) {
00038 $database = aliroDatabase::getInstance();
00039 $query = 'SELECT id AS value, name AS text FROM #__groups ORDER BY id';
00040 $database->setQuery( $query );
00041 $groups = $database->loadObjectList();
00042 $access = mosHTML::selectList( $groups, 'access', 'class="inputbox" size="3"', 'value', 'text', intval( $row->access ) );
00043 return $access;
00044 }
00045
00049 public static function Published( &$row ) {
00050 $published = mosHTML::yesnoRadioList( 'published', 'class="inputbox"', $row->published );
00051 return $published;
00052 }
00053
00057 public static function Link( &$row, $id, $link=NULL ) {
00058 die('mosAdminMenus::Link() has been withdrawn');
00059 }
00060
00064 public static function Target( &$row ) {
00065 $click[] = mosHTML::makeOption( '0', T_('Parent Window With Browser Navigation'));
00066 $click[] = mosHTML::makeOption( '1', T_('New Window With Browser Navigation'));
00067 $click[] = mosHTML::makeOption( '2', T_('New Window Without Browser Navigation'));
00068 $target = mosHTML::selectList( $click, 'browserNav', 'class="inputbox" size="4"', 'value', 'text', intval( $row->browserNav ) );
00069 return $target;
00070 }
00071
00075 public static function Category( &$menu, $id, $javascript='' ) {
00076 $database = aliroDatabase::getInstance();
00077 $query = "SELECT c.id AS `value`, c.section AS `id`, CONCAT_WS( ' / ', s.title, c.title) AS `text`"
00078 . "\n FROM #__sections AS s"
00079 . "\n INNER JOIN #__categories AS c ON c.section = s.id"
00080 . "\n WHERE s.scope = 'content'"
00081 . "\n ORDER BY s.name,c.name"
00082 ;
00083 $database->setQuery( $query );
00084 $rows = $database->loadObjectList();
00085 $category = '';
00086 if ( $id ) {
00087 foreach ( $rows as $row ) {
00088 if ( $row->value == $menu->componentid ) {
00089 $category = $row->text;
00090 }
00091 }
00092 $category .= '<input type="hidden" name="componentid" value="'. $menu->componentid .'" />';
00093 $category .= '<input type="hidden" name="link" value="'. $menu->link .'" />';
00094 } else {
00095 $category = mosHTML::selectList( $rows, 'componentid', 'class="inputbox" size="10"'. $javascript, 'value', 'text' );
00096 $category .= '<input type="hidden" name="link" value="" />';
00097 }
00098 return $category;
00099 }
00100
00104 public static function Section( &$menu, $id, $all=0 ) {
00105 $database = aliroDatabase::getInstance();
00106 $query = "SELECT s.id AS `value`, s.id AS `id`, s.title AS `text`"
00107 . "\n FROM #__sections AS s"
00108 . "\n WHERE s.scope = 'content'"
00109 . "\n ORDER BY s.name"
00110 ;
00111 $database->setQuery( $query );
00112 if ( $all ) {
00113 $rows[] = mosHTML::makeOption( 0, T_('- All Sections -') );
00114 $rows = array_merge( $rows, $database->loadObjectList() );
00115 } else {
00116 $rows = $database->loadObjectList();
00117 }
00118
00119 if ( $id ) {
00120 foreach ( $rows as $row ) {
00121 if ( $row->value == $menu->componentid ) {
00122 $section = $row->text;
00123 }
00124 }
00125 $section .= '<input type="hidden" name="componentid" value="'. $menu->componentid .'" />';
00126 $section .= '<input type="hidden" name="link" value="'. $menu->link .'" />';
00127 } else {
00128 $section = mosHTML::selectList( $rows, 'componentid', 'class="inputbox" size="10"', 'value', 'text' );
00129 $section .= '<input type="hidden" name="link" value="" />';
00130 }
00131 return $section;
00132 }
00133
00137 public static function Component( &$menu, $id ) {
00138 die ('mosAdminMenu::Component() has been withdrawn');
00139 }
00140
00144 public static function ComponentName( &$menu, $id ) {
00145 die ('mosAdminMenu::ComponentName() has been withdrawn');
00146 }
00147
00151 public static function Images( $name, &$active, $javascript=NULL, $directory=NULL ) {
00152 if ( !$javascript ) {
00153 $javascript = "onchange=\"javascript:if (document.forms[0].image.options[selectedIndex].value!='') {document.imagelib.src='../images/stories/' + document.forms[0].image.options[selectedIndex].value} else {document.imagelib.src='../images/blank.png'}\"";
00154 }
00155 if ( !$directory ) {
00156 $directory = '/images/stories';
00157 }
00158
00159 $info = criticalInfo::getInstance();
00160 $dir = new aliroDirectory ($info->absolute_path.$directory);
00161 $imageFiles = $dir->listFiles ();
00162 $images = array( mosHTML::makeOption( '', T_('- Select Image -') ) );
00163 foreach ( $imageFiles as $file ) {
00164 if ( eregi( "bmp|gif|jpg|png", $file ) ) {
00165 $images[] = mosHTML::makeOption( $file );
00166 }
00167 }
00168 $images = mosHTML::selectList( $images, $name, 'class="inputbox" size="1" '. $javascript, 'value', 'text', $active );
00169
00170 return $images;
00171 }
00172
00176 public static function SpecificOrdering( &$row, $id, $query, $neworder=0 ) {
00177 if ( $neworder ) {
00178 $text = T_('New items default to the first place. Ordering can be changed after this item is saved.');
00179 } else {
00180 $text = T_('New items default to the last place. Ordering can be changed after this item is saved.');
00181 }
00182
00183 if ( $id ) {
00184 $order = mosAdminMenus::mosGetOrderingList( $row, $query );
00185 $ordering = mosHTML::selectList( $order, 'ordering', 'class="inputbox" size="1"', 'value', 'text', intval( $row->ordering ) );
00186 } else {
00187 $ordering = '<input type="hidden" name="ordering" value="'. $row->ordering .'" />'. $text;
00188 }
00189 return $ordering;
00190 }
00191
00195 public static function UserSelect( $name, $active, $nouser=0, $javascript=NULL, $order='name' ) {
00196 $database = aliroDatabase::getInstance();
00197 $query = "SELECT id AS value, name AS text"
00198 . "\n FROM #__users"
00199 . "\n WHERE block = '0'"
00200 . "\n ORDER BY ". $order
00201 ;
00202 $database->setQuery( $query );
00203 if ( $nouser ) {
00204 $users[] = mosHTML::makeOption( '0', T_('- No User -') );
00205 $users = array_merge( $users, $database->loadObjectList() );
00206 } else {
00207 $users = $database->loadObjectList();
00208 }
00209
00210 $users = mosHTML::selectList( $users, $name, 'class="inputbox" size="1" '. $javascript, 'value', 'text', $active );
00211
00212 return $users;
00213 }
00214
00218 public static function Positions( $name, $active=NULL, $javascript=NULL, $none=1, $center=1, $left=1, $right=1 ) {
00219 if ( $none ) {
00220 $pos[] = mosHTML::makeOption( '', T_('None') );
00221 }
00222 if ( $center ) {
00223 $pos[] = mosHTML::makeOption( 'center', T_('Center') );
00224 }
00225 if ( $left ) {
00226 $pos[] = mosHTML::makeOption( 'left', T_('Left') );
00227 }
00228 if ( $right ) {
00229 $pos[] = mosHTML::makeOption( 'right', T_('Right') );
00230 }
00231
00232 $positions = mosHTML::selectList( $pos, $name, 'class="inputbox" size="1"'. $javascript, 'value', 'text', $active );
00233
00234 return $positions;
00235 }
00236
00240 public static function ComponentCategory( $name, $section, $active=NULL, $javascript=NULL, $order='ordering', $size=1, $sel_cat=1 ) {
00241 $database = aliroDatabase::getInstance();
00242 $query = "SELECT id AS value, name AS text"
00243 . "\n FROM #__categories"
00244 . "\n WHERE section = '". $section ."'"
00245 . "\n AND published = '1'"
00246 . "\n ORDER BY ". $order
00247 ;
00248 $database->setQuery( $query );
00249 $cats = $database->loadObjectList();
00250 if ( $sel_cat ) {
00251 $categories[] = mosHTML::makeOption( '0', T_('- All Categories -') );
00252 if ($cats) $categories = array_merge($categories, $cats);
00253 } else {
00254 $categories = $cats ? $cats : array();
00255 }
00256
00257 if ( count( $categories ) < 1 ) {
00258 mosRedirect( 'index.php?option=com_categories§ion='. $section, T_('You must create a category first.') );
00259 }
00260
00261 $category = mosHTML::selectList( $categories, $name, 'class="inputbox" size="'. $size .'" '. $javascript, 'value', 'text', $active );
00262
00263 return $category;
00264 }
00265
00269 public static function SelectSection( $name, $active=NULL, $javascript=NULL, $order='ordering' ) {
00270 $database = aliroDatabase::getInstance();
00271 $categories[] = mosHTML::makeOption( '0', T_('- All Sections -') );
00272 $query = "SELECT id AS value, title AS text"
00273 . "\n FROM #__sections"
00274 . "\n WHERE published = '1'"
00275 . "\n ORDER BY ". $order
00276 ;
00277 $results = $database->setQuery( $query );
00278 if ($results) $categories = array_merge ($categories, $results);
00279 return mosHTML::selectList( $categories, $name, 'class="inputbox" size="1" '. $javascript, 'value', 'text', $active );
00280 }
00281
00285 public static function Links2Menu( $type, $_and ) {
00286 $database = aliroCoreDatabase::getInstance();
00287 $query = "SELECT *"
00288 . "\n FROM #__menu"
00289 . "\n WHERE type = '". $type ."'"
00290 . "\n AND published = '1'"
00291 . $_and
00292 ;
00293 $database->setQuery( $query );
00294 $menus = $database->loadObjectList();
00295
00296 return $menus;
00297 }
00298
00302 public static function MenuSelect( $name='menuselect', $javascript=NULL ) {
00303 $database = aliroCoreDatabase::getInstance();
00304 $query = "SELECT params"
00305 . "\n FROM #__modules"
00306 . "\n WHERE module = 'mod_mainmenu'"
00307 ;
00308 $database->setQuery( $query );
00309 $menus = $database->loadObjectList();
00310 $total = count( $menus );
00311 for( $i = 0; $i < $total; $i++ ) {
00312 $paramcode = $menus[$i]->params;
00313 $params = $paramcode ? unserialize ($paramcode) : array();
00314 foreach ($params as &$param) $param = base64_decode($param);
00315 if (isset($params['menutype'])) {
00316 $menuselect[$i]->value = $params['menutype'];
00317 $menuselect[$i]->text = $params['menutype'];
00318 }
00319 }
00320
00321 if (isset($menuselect)) {
00322 SortArrayObjects( $menuselect, 'text', 1 );
00323 $menus = mosHTML::selectList( $menuselect, $name, 'class="inputbox" size="10" '. $javascript, 'value', 'text' );
00324 return $menus;
00325 }
00326 else return '';
00327 }
00328
00335 public static function ImageCheckAdmin( $file, $directory, $param=NULL, $param_directory='/administrator/images/', $alt=NULL, $name=NULL, $type=1, $align='middle' ) {
00336 $mosConfig_absolute_path = aliroCore::get('mosConfig_absolute_path');
00337 $mosConfig_admin_site = aliroCore::get('mosConfig_admin_site');
00338 $mosConfig_live_site = aliroCore::get('mosConfig_live_site');
00339 $mainframe = mosMainFrame::getInstance();
00340 $cur_template = $mainframe->getTemplate();
00341
00342 if ( $param ) {
00343 $image = $mosConfig_live_site. $param_directory . $param;
00344 if ( $type ) {
00345 $image = '<img src="'. $image .'" align="'. $align .'" alt="'. $alt .'" name="'. $name .'" border="0" />';
00346 }
00347 } else if ( $param == -1 ) {
00348 $image = '';
00349 } else {
00350 if ( file_exists( $mainframe->getCfg ('admin_absolute_path') .'/templates/'. $cur_template .'/images/'. $file ) ) {
00351 $image = $mosConfig_admin_site .'/templates/'. $cur_template .'/images/'. $file;
00352 } else {
00353 $image = $mosConfig_live_site. $directory . $file;
00354 }
00355
00356
00357 if ( $type ) {
00358 $image = '<img src="'. $image .'" alt="'. $alt .'" align="'. $align .'" name="'. $name .'" border="0" />';
00359 }
00360 }
00361
00362 return $image;
00363 }
00364
00372 public static function ReadImages( $imagePath, $folderPath, &$folders, &$images ) {
00373 $dir = new aliroDirectory ($imagePath);
00374 $imgFiles = $dir->listFiles ();
00375
00376 foreach ($imgFiles as $file) {
00377 $ff_ = $folderPath . $file .'/';
00378 $ff = $folderPath . $file;
00379 $i_f = $imagePath .'/'. $file;
00380
00381 if ( is_dir( $i_f ) && $file <> 'CVS' ) {
00382 $folders[] = mosHTML::makeOption( $ff_ );
00383 mosAdminMenus::ReadImages( $i_f, $ff_, $folders, $images );
00384 } else if ( eregi( "bmp|gif|jpg|png", $file ) && is_file( $i_f ) ) {
00385
00386 $imageFile = substr( $ff, 1 );
00387 $images[$folderPath][] = mosHTML::makeOption( $imageFile, $file );
00388 }
00389 }
00390 }
00391
00392 public static function GetImageFolders( &$folders, $path ) {
00393 $javascript = "onchange=\"changeDynaList( 'imagefiles', folderimages, document.adminForm.folders.options[document.adminForm.folders.selectedIndex].value, 0, 0); previewImage( 'imagefiles', 'view_imagefiles', '$path/' );\"";
00394 $getfolders = mosHTML::selectList( $folders, 'folders', 'class="inputbox" size="1" '. $javascript, 'value', 'text', '/' );
00395 return $getfolders;
00396 }
00397
00398 public static function GetImages( &$images, $path ) {
00399 if ( !isset($images['/'] ) ) {
00400 $images['/'][] = mosHTML::makeOption( '' );
00401 }
00402
00403
00404 $javascript = "onchange=\"previewImage( 'imagefiles', 'view_imagefiles', '$path/' )\"";
00405 $getimages = mosHTML::selectList( $images['/'], 'imagefiles', 'class="inputbox" size="10" multiple="multiple" '. $javascript , 'value', 'text', null );
00406
00407 return $getimages;
00408 }
00409
00410 public static function GetSavedImages( &$row, $path ) {
00411 $images2 = array();
00412 foreach( $row->images as $file ) {
00413 $temp = explode( '|', $file );
00414 if( strrchr($temp[0], '/') ) {
00415 $filename = substr( strrchr($temp[0], '/' ), 1 );
00416 } else {
00417 $filename = $temp[0];
00418 }
00419 $images2[] = mosHTML::makeOption( $file, $filename );
00420 }
00421
00422 $javascript = "onchange=\"previewImage( 'imagelist', 'view_imagelist', '$path/' ); showImageProps( '$path/' ); \"";
00423 $imagelist = mosHTML::selectList( $images2, 'imagelist', 'class="inputbox" size="10" '. $javascript, 'value', 'text' );
00424
00425 return $imagelist;
00426 }
00427
00428 public static function menutypes() {
00429 die ('mosAdminMenu::menutypes() has been withdrawn');
00430 }
00431
00432
00433
00434
00435 public static function menuItem( $item ) {
00436 die ('mosAdminMenu::menuItem() has been withdrawn');
00437 }
00438
00443 private static function mosGetOrderingList( $row, $sql, $chop='30' ) {
00444 $order = array();
00445 $database = $row->getDatabase();
00446 $database->setQuery( $sql );
00447 if (!($orders = $database->loadObjectList())) {
00448 if ($database->getErrorNum()) {
00449 echo $database->stderr();
00450 return false;
00451 } else {
00452 $order[] = mosHTML::makeOption( 1, 'first' );
00453 return $order;
00454 }
00455 }
00456 $order[] = mosHTML::makeOption( 0, '0 first' );
00457 for ($i=0, $n=count( $orders ); $i < $n; $i++) {
00458
00459 if (strlen($orders[$i]->text) > $chop) {
00460 $text = substr($orders[$i]->text,0,$chop)."...";
00461 } else {
00462 $text = $orders[$i]->text;
00463 }
00464
00465 $order[] = mosHTML::makeOption( $orders[$i]->value, $orders[$i]->value.' ('.$text.')' );
00466 }
00467 $order[] = mosHTML::makeOption( $orders[$i-1]->value+1, ($orders[$i-1]->value+1).' last' );
00468
00469 return $order;
00470 }
00471
00472 }
00473
00474 class mosToolBar {
00475
00479 function startTable() {
00480 ?>
00481 <table cellpadding="0" cellspacing="0" border="0" width="99%">
00482 <tr>
00483 <?php
00484 }
00485
00494 function custom( $task='', $icon='', $iconOver='', $alt='', $listSelect=true ) {
00495 if ($listSelect) {
00496 $href = "javascript:if (document.adminForm.boxchecked.value == 0){ alert('".T_('Please make a selection from the list to') ." $alt');}else{submitbutton('$task')}";
00497 } else {
00498 $href = "javascript:submitbutton('$task')";
00499 }
00500 ?>
00501 <td width="25" align="center">
00502 <a href="<?php echo $href;?>" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','images/<?php echo $iconOver;?>',1);">
00503 <img name="<?php echo $task;?>" src="images/<?php echo $icon;?>" alt="<?php echo $alt;?>" border="0" />
00504 </a>
00505 </td>
00506 <?php
00507 }
00508
00514 function addNew( $task='new', $alt=null ) {
00515 if (is_null($alt)) $alt = T_('New');
00516
00517 $mainframe = mosMainFrame::getInstance();
00518 $image = $mainframe->ImageCheck( 'new.png', '/images/', NULL, NULL, $alt, $task );
00519 $image2 = $mainframe->ImageCheck( 'new_f2.png', '/images/', NULL, NULL, $alt, $task, 0 );
00520 ?>
00521 <td width="25" align="center">
00522 <a href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);">
00523 <?php echo $image; ?>
00524 </a>
00525 </td>
00526 <?php
00527 }
00528
00534 function publish( $task='publish', $alt=null ) {
00535 if (is_null($alt)) $alt = T_('Published');
00536
00537 $mainframe = mosMainFrame::getInstance();
00538 $image = $mainframe->ImageCheck( 'publish.png', '/images/', NULL, NULL, $alt, $task );
00539 $image2 = $mainframe->ImageCheck( 'publish_f2.png', '/images/', NULL, NULL, $alt, $task, 0 );
00540 ?>
00541 <td width="25" align="center">
00542 <a href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);">
00543 <?php echo $image; ?>
00544 </a>
00545 </td>
00546 <?php
00547 }
00548
00554 function publishList( $task='publish', $alt=null ) {
00555 if (is_null($alt)) $alt = T_('Published');
00556
00557 $mainframe = mosMainFrame::getInstance();
00558 $image = $mainframe->ImageCheck( 'publish.png', '/images/', NULL, NULL, $alt, $task );
00559 $image2 = $mainframe->ImageCheck( 'publish_f2.png', '/images/', NULL, NULL, $alt, $task, 0 );
00560 ?>
00561 <td width="25" align="center">
00562 <a 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);">
00563 <?php echo $image; ?>
00564 </a>
00565 </td>
00566 <?php
00567 }
00568
00574 function unpublish( $task='unpublish', $alt=null ) {
00575 if (is_null($alt)) $alt = T_('Unpublished');
00576
00577 $mainframe = mosMainFrame::getInstance();
00578 $image = $mainframe->ImageCheck( 'unpublish.png', '/images/', NULL, NULL, $alt, $task );
00579 $image2 = $mainframe->ImageCheck( 'unpublish_f2.png', '/images/', NULL, NULL, $alt, $task, 0 );
00580 ?>
00581 <td width="25" align="center">
00582 <a href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2; ?>',1);" >
00583 <?php echo $image; ?>
00584 </a>
00585 </td>
00586 <?php
00587 }
00588
00594 function unpublishList( $task='unpublish', $alt=null ) {
00595 if (is_null($alt)) $alt = T_('Unpublished');
00596
00597 $mainframe = mosMainFrame::getInstance();
00598 $image = $mainframe->ImageCheck( 'unpublish.png', '/images/', NULL, NULL, $alt, $task );
00599 $image2 = $mainframe->ImageCheck( 'unpublish_f2.png', '/images/', NULL, NULL, $alt, $task, 0 );
00600 ?>
00601 <td width="25" align="center">
00602 <a href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php 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);" >
00603 <?php echo $image; ?>
00604 </a>
00605 </td>
00606 <?php
00607 }
00608
00614 function archiveList( $task='archive', $alt=null ) {
00615 if (is_null($alt)) $alt = T_('Archive');
00616
00617 $mainframe = mosMainFrame::getInstance();
00618 $image = $mainframe->ImageCheck( 'archive.png', '/images/', NULL, NULL, $alt, $task );
00619 $image2 = $mainframe->ImageCheck( 'archive_f2.png', '/images/', NULL, NULL, $alt, $task, 0 );
00620 ?>
00621 <td width="25" align="center">
00622 <a href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php 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);">
00623 <?php echo $image; ?>
00624 </a>
00625 </td>
00626 <?php
00627 }
00628
00634 function unarchiveList( $task='unarchive', $alt=null ) {
00635 if (is_null($alt)) $alt = T_('Unarchive');
00636
00637 $mainframe = mosMainFrame::getInstance();
00638 $image = $mainframe->ImageCheck( 'unarchive.png', '/images/', NULL, NULL, $alt, $task );
00639 $image2 = $mainframe->ImageCheck( 'unarchive_f2.png', '/images/', NULL, NULL, $alt, $task, 0 );
00640 ?>
00641 <td width="25" align="center">
00642 <a href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php 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);">
00643 <?php echo $image; ?>
00644 </a>
00645 </td>
00646 <?php
00647 }
00648
00654 function editList( $task='edit', $alt=null ) {
00655 if (is_null($alt)) $alt = T_('Edit');
00656
00657 $mainframe = mosMainFrame::getInstance();
00658 $image = $mainframe->ImageCheck( 'html.png', '/images/', NULL, NULL, $alt, $task );
00659 $image2 = $mainframe->ImageCheck( 'html_f2.png', '/images/', NULL, NULL, $alt, $task, 0 );
00660 ?>
00661 <td width="25" align="center">
00662 <a href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php 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);">
00663 <?php echo $image; ?>
00664 </a>
00665 </td>
00666 <?php
00667 }
00668
00674 function editHtml( $task='edit_source', $alt=null ) {
00675 if (is_null($alt)) $alt = T_('Edit HTML');
00676 $mainframe = mosMainFrame::getInstance();
00677 $image = $mainframe->ImageCheck( 'html.png', '/images/', NULL, NULL, $alt, $task );
00678 $image2 = $mainframe->ImageCheck( 'html_f2.png', '/images/', NULL, NULL, $alt, $task, 0 );
00679 ?>
00680 <td width="25" align="center">
00681 <a href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php 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);">
00682 <?php echo $image; ?>
00683 </a>
00684 </td>
00685 <?php
00686 }
00687
00693 function editCss( $task='edit_css', $alt=null ) {
00694 if (is_null($alt)) $alt = T_('Edit CSS');
00695 $mainframe = mosMainFrame::getInstance();
00696 $image = $mainframe->ImageCheck( 'css.png', '/images/', NULL, NULL, $alt, $task );
00697 $image2 = $mainframe->ImageCheck( 'css_f2.png', '/images/', NULL, NULL, $alt, $task, 0 );
00698 ?>
00699 <td width="25" align="center">
00700 <a href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php 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);">
00701 <?php echo $image; ?>
00702 </a>
00703 </td>
00704 <?php
00705 }
00706
00713 function deleteList( $msg='', $task='remove', $alt=null ) {
00714 if (is_null($alt)) $alt = T_('Delete');
00715
00716 $mainframe = mosMainFrame::getInstance();
00717 $image = $mainframe->ImageCheck( 'delete.png', '/images/', NULL, NULL, $alt, $task );
00718 $image2 = $mainframe->ImageCheck( 'delete_f2.png', '/images/', NULL, NULL, $alt, $task, 0 );
00719 ?>
00720 <td width="25" align="center">
00721 <a href="javascript:if (document.adminForm.boxchecked.value == 0){ alert('<?php T_('Please make a selection from the list to delete') ?>'); } else if (confirm('<?php 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);">
00722 <?php echo $image; ?>
00723 </a>
00724 </td>
00725 <?php
00726 }
00727
00732 function preview( $popup='' ) {
00733 die('Preview is not currently supported');
00734 $sql = "SELECT template FROM #__templates_menu WHERE client_id='0' AND menuid='0'";
00735 $database->setQuery( $sql );
00736 $cur_template = $database->loadResult();
00737 $image = mosAdminMenus::ImageCheck( 'preview.png', 'images/', NULL, NULL, T_('Preview'), 'preview' );
00738 $image2 = mosAdminMenus::ImageCheck( 'preview_f2.png', 'images/', NULL, NULL, T_('Preview'), 'preview', 0 );
00739 ?>
00740 <td width="25" align="center">
00741 <a href="#" onclick="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');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('preview','','<?php echo $image2; ?>',1);">
00742 <?php echo $image; ?>
00743 </a>
00744 </td>
00745 <?php
00746 }
00747
00753 function save( $task='save', $alt=null ) {
00754 if (is_null($alt)) $alt = T_('Save');
00755
00756 $mainframe = mosMainFrame::getInstance();
00757 $image = $mainframe->ImageCheck( 'save.png', '/images/', NULL, NULL, $alt, $task );
00758 $image2 = $mainframe->ImageCheck( 'save_f2.png', '/images/', NULL, NULL, $alt, $task, 0 );
00759 ?>
00760 <td width="25" align="center">
00761 <a href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2;?>',1);">
00762 <?php echo $image;?>
00763 </a>
00764 </td>
00765 <?php
00766 }
00767
00771 function savenew() {
00772 $image = mosAdminMenus::ImageCheck( 'save.png', '/images/', NULL, NULL, T_('save'), 'save' );
00773 $image2 = mosAdminMenus::ImageCheck( 'save_f2.png', '/images/', NULL, NULL, T_('save'), 'save', 0 );
00774 ?>
00775 <td width="25" align="center">
00776 <a href="javascript:submitbutton('savenew');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('save','','<?php echo $image2;?>',1);">
00777 <?php echo $image;?>
00778 </a>
00779 </td>
00780 <?php
00781 }
00782
00786 function saveedit() {
00787 $image = mosAdminMenus::ImageCheck( 'save.png', '/images/', NULL, NULL, T_('save'), 'save' );
00788 $image2 = mosAdminMenus::ImageCheck( 'save_f2.png', '/images/', NULL, NULL, T_('save'), 'save', 0 );
00789 ?>
00790 <td width="25" align="center">
00791 <a href="javascript:submitbutton('saveedit');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('save','','<?php echo $image2;?>',1);">
00792 <?php echo $image;?>
00793 </a>
00794 </td>
00795 <?php
00796 }
00797
00803 function cancel( $task='cancel', $alt=null ) {
00804 if (is_null($alt)) $alt = T_('Cancel');
00805
00806 $mainframe = mosMainFrame::getInstance();
00807 $image = $mainframe->ImageCheck( 'cancel.png', '/images/', NULL, NULL, $alt, $task );
00808 $image2 = $mainframe->ImageCheck( 'cancel_f2.png', '/images/', NULL, NULL, $alt, $task, 0 );
00809 ?>
00810 <td width="25" align="center">
00811 <a href="javascript:submitbutton('<?php echo $task;?>');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('<?php echo $task;?>','','<?php echo $image2;?>',1);">
00812 <?php echo $image;?>
00813 </a>
00814 </td>
00815 <?php
00816 }
00817
00822 function back() {
00823 $image = mosAdminMenus::ImageCheck( 'back.png', '/images/', NULL, NULL, T_('back'), 'cancel' );
00824 $image2 = mosAdminMenus::ImageCheck( 'back_f2.png', '/images/', NULL, NULL, T_('back'), 'cancel', 0 );
00825 ?>
00826 <td width="25" align="center">
00827 <a href="javascript:window.history.back();" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('cancel','','images/<?php echo $image2;?>',1);">
00828 <?php echo $image;?>
00829 </a>
00830 </td>
00831 <?php
00832 }
00833
00837 function divider() {
00838 $image = $mainframe->ImageCheck( 'menu_divider.png', '/images/' );
00839 ?>
00840 <td width="25" align="center">
00841 <?php echo $image; ?>
00842 </td>
00843 <?php
00844 }
00845
00850 function media_manager( $directory = '' ) {
00851 $image = mosAdminMenus::ImageCheck( 'upload.png', '/images/', NULL, NULL, T_('Upload Image'), 'uploadPic' );
00852 $image2 = mosAdminMenus::ImageCheck( 'upload_f2.png', '/images/', NULL, NULL, T_('Upload Image'), 'uploadPic', 0 );
00853 ?>
00854 <td width="25" align="center">
00855 <a href="#" onclick="popupWindow('popups/uploadimage.php?directory=<?php echo $directory; ?>','win1',250,100,'no');" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('uploadPic','','<?php echo $image2; ?>',1);">
00856 <?php echo $image; ?>
00857 </a>
00858 </td>
00859 <?php
00860 }
00861
00866 function spacer( $width='' )
00867 {
00868 if ($width != '') {
00869 ?>
00870 <td width="<?php echo $width;?>"> </td>
00871 <?php
00872 } else {
00873 ?>
00874 <td> </td>
00875 <?php
00876 }
00877 }
00878
00882 function endTable() {
00883 ?>
00884 </tr>
00885 </table>
00886 <?php
00887 }
00888 }