| 330 |
} |
} |
| 331 |
|
|
| 332 |
|
|
|
class mosClassLoader { |
|
|
var $connection = 0; |
|
|
var $classes_loaded = array(); |
|
|
|
|
|
function mosClassLoader($database) { |
|
|
$this->connection = $database; |
|
|
} |
|
|
|
|
|
function &getInstance ($database) { |
|
|
static $loader; |
|
|
if (is_object($loader)) return $loader; |
|
|
$loader =& new mosClassLoader($database); |
|
|
return $loader; |
|
|
} |
|
|
|
|
|
function loadClass ($database, $name) { |
|
|
$loader = mosClassLoader::getInstance($database); |
|
|
if (in_array($name, $loader->classes_loaded)) return; |
|
|
$sql = "SELECT code_id FROM #__class_lookup WHERE classname=$name"; |
|
|
$loader->connection->setQuery($sql); |
|
|
$code_id = $loader->connection->loadResult(); |
|
|
if ($code_id) { |
|
|
$sql = "SELECT code FROM #__class_code WHERE id=$code_id"; |
|
|
$loader->connection->setQuery($sql); |
|
|
$code = $loader->connection->loadResult(); |
|
|
$loader->classes_loaded[] = $name; |
|
|
if ($code) eval ($code); |
|
|
else trigger_error("mosClassLoader Error - no $name class code in table row $code_id"); |
|
|
} |
|
|
else trigger_error("mosClassLoader Error - class $name not found in database"); |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
| 333 |
/** |
/** |
| 334 |
* Component database table class |
* Component database table class |
| 335 |
* @package Mambo |
* @package Mambo |
| 369 |
} |
} |
| 370 |
|
|
| 371 |
/** |
/** |
|
* Utility class for all HTML drawing classes |
|
|
* @package Mambo |
|
|
*/ |
|
|
class mosHTML { |
|
|
function makeOption( $value, $text='' ) { |
|
|
$obj = new stdClass; |
|
|
$obj->value = $value; |
|
|
$obj->text = trim( $text ) ? $text : $value; |
|
|
return $obj; |
|
|
} |
|
|
|
|
|
function writableCell( $folder ) { |
|
|
|
|
|
echo '<tr>'; |
|
|
echo '<td class="item">' . $folder . '/</td>'; |
|
|
echo '<td align="left">'; |
|
|
echo is_writable( "../$folder" ) ? '<b><font color="green">Writeable</font></b>' : '<b><font color="red">Unwriteable</font></b>' . '</td>'; |
|
|
echo '</tr>'; |
|
|
} |
|
|
|
|
|
/** |
|
|
* Generates an HTML select list |
|
|
* @param array An array of objects |
|
|
* @param string The value of the HTML name attribute |
|
|
* @param string Additional HTML attributes for the <select> tag |
|
|
* @param string The name of the object variable for the option value |
|
|
* @param string The name of the object variable for the option text |
|
|
* @param mixed The key that is selected |
|
|
* @returns string HTML for the select list |
|
|
*/ |
|
|
function selectList ( &$arr, $tag_name, $tag_attribs, $key, $text, $selected=NULL ) { |
|
|
reset( $arr ); |
|
|
$html = "\n<select name=\"$tag_name\" $tag_attribs>"; |
|
|
for ($i=0, $n=count( $arr ); $i < $n; $i++ ) { |
|
|
$k = $arr[$i]->$key; |
|
|
$t = $arr[$i]->$text; |
|
|
$id = @$arr[$i]->id; |
|
|
|
|
|
$extra = ''; |
|
|
$extra .= $id ? " id=\"" . $arr[$i]->id . "\"" : ''; |
|
|
if (is_array( $selected )) { |
|
|
foreach ($selected as $obj) { |
|
|
$k2 = $obj->$key; |
|
|
if ($k == $k2) { |
|
|
$extra .= " selected=\"selected\""; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} else { |
|
|
$extra .= ($k == $selected ? " selected=\"selected\"" : ''); |
|
|
} |
|
|
$html .= "\n\t<option value=\"".$k."\"$extra>" . $t . "</option>"; |
|
|
} |
|
|
$html .= "\n</select>\n"; |
|
|
return $html; |
|
|
} |
|
|
|
|
|
/** |
|
|
* Writes a select list of integers |
|
|
* @param int The start integer |
|
|
* @param int The end integer |
|
|
* @param int The increment |
|
|
* @param string The value of the HTML name attribute |
|
|
* @param string Additional HTML attributes for the <select> tag |
|
|
* @param mixed The key that is selected |
|
|
* @param string The printf format to be applied to the number |
|
|
* @returns string HTML for the select list |
|
|
*/ |
|
|
function integerSelectList( $start, $end, $inc, $tag_name, $tag_attribs, $selected, $format="" ) { |
|
|
$start = intval( $start ); |
|
|
$end = intval( $end ); |
|
|
$inc = intval( $inc ); |
|
|
$arr = array(); |
|
|
for ($i=$start; $i <= $end; $i+=$inc) { |
|
|
$fi = $format ? sprintf( "$format", $i ) : "$i"; |
|
|
$arr[] = mosHTML::makeOption( $fi, $fi ); |
|
|
} |
|
|
|
|
|
return mosHTML::selectList( $arr, $tag_name, $tag_attribs, 'value', 'text', $selected ); |
|
|
} |
|
|
|
|
|
/** |
|
|
* Writes a select list of month names based on Language settings |
|
|
* @param string The value of the HTML name attribute |
|
|
* @param string Additional HTML attributes for the <select> tag |
|
|
* @param mixed The key that is selected |
|
|
* @returns string HTML for the select list values |
|
|
*/ |
|
|
function monthSelectList( $tag_name, $tag_attribs, $selected ) { |
|
|
$arr = array( |
|
|
mosHTML::makeOption( '01', _JAN ), |
|
|
mosHTML::makeOption( '02', _FEB ), |
|
|
mosHTML::makeOption( '03', _MAR ), |
|
|
mosHTML::makeOption( '04', _APR ), |
|
|
mosHTML::makeOption( '05', _MAY ), |
|
|
mosHTML::makeOption( '06', _JUN ), |
|
|
mosHTML::makeOption( '07', _JUL ), |
|
|
mosHTML::makeOption( '08', _AUG ), |
|
|
mosHTML::makeOption( '09', _SEP ), |
|
|
mosHTML::makeOption( '10', _OCT ), |
|
|
mosHTML::makeOption( '11', _NOV ), |
|
|
mosHTML::makeOption( '12', _DEC ) |
|
|
); |
|
|
|
|
|
return mosHTML::selectList( $arr, $tag_name, $tag_attribs, 'value', 'text', $selected ); |
|
|
} |
|
|
|
|
|
/** |
|
|
* Generates an HTML select list from a tree based query list |
|
|
* @param array Source array with id and parent fields |
|
|
* @param array The id of the current list item |
|
|
* @param array Target array. May be an empty array. |
|
|
* @param array An array of objects |
|
|
* @param string The value of the HTML name attribute |
|
|
* @param string Additional HTML attributes for the <select> tag |
|
|
* @param string The name of the object variable for the option value |
|
|
* @param string The name of the object variable for the option text |
|
|
* @param mixed The key that is selected |
|
|
* @returns string HTML for the select list |
|
|
*/ |
|
|
function treeSelectList( &$src_list, $src_id, $tgt_list, $tag_name, $tag_attribs, $key, $text, $selected ) { |
|
|
|
|
|
// establish the hierarchy of the menu |
|
|
$children = array(); |
|
|
// first pass - collect children |
|
|
foreach ($src_list as $v ) { |
|
|
$pt = $v->parent; |
|
|
$list = @$children[$pt] ? $children[$pt] : array(); |
|
|
array_push( $list, $v ); |
|
|
$children[$pt] = $list; |
|
|
} |
|
|
// second pass - get an indent list of the items |
|
|
$ilist = mosTreeRecurse( 0, '', array(), $children ); |
|
|
|
|
|
// assemble menu items to the array |
|
|
$this_treename = ''; |
|
|
foreach ($ilist as $item) { |
|
|
if ($this_treename) { |
|
|
if ($item->id != $src_id && strpos( $item->treename, $this_treename ) === false) { |
|
|
$tgt_list[] = mosHTML::makeOption( $item->id, $item->treename ); |
|
|
} |
|
|
} else { |
|
|
if ($item->id != $src_id) { |
|
|
$tgt_list[] = mosHTML::makeOption( $item->id, $item->treename ); |
|
|
} else { |
|
|
$this_treename = "$item->treename/"; |
|
|
} |
|
|
} |
|
|
} |
|
|
// build the html select list |
|
|
return mosHTML::selectList( $tgt_list, $tag_name, $tag_attribs, $key, $text, $selected ); |
|
|
} |
|
|
|
|
|
/** |
|
|
* Writes a yes/no select list |
|
|
* @param string The value of the HTML name attribute |
|
|
* @param string Additional HTML attributes for the <select> tag |
|
|
* @param mixed The key that is selected |
|
|
* @returns string HTML for the select list values |
|
|
*/ |
|
|
function yesnoSelectList( $tag_name, $tag_attribs, $selected, $yes=_CMN_YES, $no=_CMN_NO ) { |
|
|
$arr = array( |
|
|
mosHTML::makeOption( '0', $no ), |
|
|
mosHTML::makeOption( '1', $yes ), |
|
|
); |
|
|
|
|
|
return mosHTML::selectList( $arr, $tag_name, $tag_attribs, 'value', 'text', $selected ); |
|
|
} |
|
|
|
|
|
/** |
|
|
* Generates an HTML radio list |
|
|
* @param array An array of objects |
|
|
* @param string The value of the HTML name attribute |
|
|
* @param string Additional HTML attributes for the <select> tag |
|
|
* @param mixed The key that is selected |
|
|
* @param string The name of the object variable for the option value |
|
|
* @param string The name of the object variable for the option text |
|
|
* @returns string HTML for the select list |
|
|
*/ |
|
|
function radioList( &$arr, $tag_name, $tag_attribs, $selected=null, $key='value', $text='text' ) { |
|
|
reset( $arr ); |
|
|
$html = ""; |
|
|
for ($i=0, $n=count( $arr ); $i < $n; $i++ ) { |
|
|
$k = $arr[$i]->$key; |
|
|
$t = $arr[$i]->$text; |
|
|
$id = @$arr[$i]->id; |
|
|
|
|
|
$extra = ''; |
|
|
$extra .= $id ? " id=\"" . $arr[$i]->id . "\"" : ''; |
|
|
if (is_array( $selected )) { |
|
|
foreach ($selected as $obj) { |
|
|
$k2 = $obj->$key; |
|
|
if ($k == $k2) { |
|
|
$extra .= " selected=\"selected\""; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} else { |
|
|
$extra .= ($k == $selected ? " checked=\"checked\"" : ''); |
|
|
} |
|
|
$html .= "\n\t<input type=\"radio\" name=\"$tag_name\" value=\"".$k."\"$extra $tag_attribs />" . $t; |
|
|
} |
|
|
$html .= "\n"; |
|
|
return $html; |
|
|
} |
|
|
|
|
|
/** |
|
|
* Writes a yes/no radio list |
|
|
* @param string The value of the HTML name attribute |
|
|
* @param string Additional HTML attributes for the <select> tag |
|
|
* @param mixed The key that is selected |
|
|
* @returns string HTML for the radio list |
|
|
*/ |
|
|
function yesnoRadioList( $tag_name, $tag_attribs, $selected, $yes=_CMN_YES, $no=_CMN_NO ) { |
|
|
$arr = array( |
|
|
mosHTML::makeOption( '0', $no, true ), |
|
|
mosHTML::makeOption( '1', $yes, true ) |
|
|
); |
|
|
return mosHTML::radioList( $arr, $tag_name, $tag_attribs, $selected ); |
|
|
} |
|
|
|
|
|
/** |
|
|
* @param int The row index |
|
|
* @param int The record id |
|
|
* @param boolean |
|
|
* @param string The name of the form element |
|
|
* @return string |
|
|
*/ |
|
|
function idBox( $rowNum, $recId, $checkedOut=false, $name='cid' ) { |
|
|
if ( $checkedOut ) { |
|
|
return ''; |
|
|
} else { |
|
|
return '<input type="checkbox" id="cb'.$rowNum.'" name="'.$name.'[]" value="'.$recId.'" onclick="isChecked(this.checked);" />'; |
|
|
} |
|
|
} |
|
|
|
|
|
function sortIcon( $base_href, $field, $state='none' ) { |
|
|
global $mosConfig_live_site; |
|
|
|
|
|
$alts = array( |
|
|
'none' => _CMN_SORT_NONE, |
|
|
'asc' => _CMN_SORT_ASC, |
|
|
'desc' => _CMN_SORT_DESC, |
|
|
); |
|
|
$next_state = 'asc'; |
|
|
if ($state == 'asc') { |
|
|
$next_state = 'desc'; |
|
|
} else if ($state == 'desc') { |
|
|
$next_state = 'none'; |
|
|
} |
|
|
|
|
|
$html = "<a href=\"$base_href&field=$field&order=$next_state\">" |
|
|
. "<img src=\"$mosConfig_live_site/images/M_images/sort_$state.png\" width=\"12\" height=\"12\" border=\"0\" alt=\"{$alts[$next_state]}\" />" |
|
|
. "</a>"; |
|
|
return $html; |
|
|
} |
|
|
|
|
|
/** |
|
|
* Writes Close Button |
|
|
*/ |
|
|
function CloseButton ( &$params, $hide_js=NULL ) { |
|
|
// displays close button in Pop-up window |
|
|
if ( $params->get( 'popup' ) && !$hide_js ) { |
|
|
?> |
|
|
<div align="center" style="margin-top: 30px; margin-bottom: 30px;"> |
|
|
<a href='javascript:window.close();'> |
|
|
<span class="small"> |
|
|
<?php echo _PROMPT_CLOSE;?> |
|
|
</span> |
|
|
</a> |
|
|
</div> |
|
|
<?php |
|
|
} |
|
|
} |
|
|
|
|
|
/** |
|
|
* Writes Back Button |
|
|
*/ |
|
|
function BackButton ( &$params, $hide_js=NULL ) { |
|
|
// Back Button |
|
|
if ( $params->get( 'back_button' ) && !$params->get( 'popup' ) && !$hide_js) { |
|
|
?> |
|
|
<div class="back_button"> |
|
|
<a href='javascript:history.go(-1)'> |
|
|
<?php echo _BACK; ?> |
|
|
</a> |
|
|
</div> |
|
|
<?php |
|
|
} |
|
|
} |
|
|
|
|
|
/** |
|
|
* Cleans text of all formating and scripting code |
|
|
*/ |
|
|
function cleanText ( &$text ) { |
|
|
$text = preg_replace( "'<script[^>]*>.*?</script>'si", '', $text ); |
|
|
$text = preg_replace( '/<a\s+.*?href="([^"]+)"[^>]*>([^<]+)<\/a>/is', '\2 (\1)', $text ); |
|
|
$text = preg_replace( '/<!--.+?-->/', '', $text ); |
|
|
$text = preg_replace( '/{.+?}/', '', $text ); |
|
|
$text = preg_replace( '/ /', ' ', $text ); |
|
|
$text = preg_replace( '/&/', ' ', $text ); |
|
|
$text = preg_replace( '/"/', ' ', $text ); |
|
|
$text = strip_tags( $text ); |
|
|
$text = htmlspecialchars( $text ); |
|
|
return $text; |
|
|
} |
|
|
|
|
|
/** |
|
|
* Writes Print icon |
|
|
*/ |
|
|
function PrintIcon( &$row, &$params, $hide_js, $link, $status=NULL ) { |
|
|
global $mosConfig_live_site, $mosConfig_absolute_path, $cur_template, $Itemid; |
|
|
if ( $params->get( 'print' ) && !$hide_js ) { |
|
|
// use default settings if none declared |
|
|
if ( !$status ) { |
|
|
$status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no'; |
|
|
} |
|
|
|
|
|
// checks template image directory for image, if non found default are loaded |
|
|
if ( $params->get( 'icons' ) ) { |
|
|
$mainframe = mosMainFrame::getInstance(); |
|
|
$image = $mainframe->ImageCheck( 'printButton.png', '/images/M_images/', NULL, NULL, _CMN_PRINT ); |
|
|
} else { |
|
|
$image = _ICON_SEP .' '. _CMN_PRINT. ' '. _ICON_SEP; |
|
|
} |
|
|
|
|
|
if ( $params->get( 'popup' ) && !$hide_js ) { |
|
|
// Print Preview button - used when viewing page |
|
|
?> |
|
|
<td align="right" width="100%" class="buttonheading"> |
|
|
<a href="#" onclick="javascript:window.print(); return false" title="<?php echo _CMN_PRINT;?>"> |
|
|
<?php echo $image;?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
|
} else { |
|
|
// Print Button - used in pop-up window |
|
|
?> |
|
|
<td align="right" width="100%" class="buttonheading"> |
|
|
<a href="javascript:void window.open('<?php echo $link; ?>', 'win2', '<?php echo $status; ?>');" title="<?php echo _CMN_PRINT;?>"> |
|
|
<?php echo $image;?> |
|
|
</a> |
|
|
</td> |
|
|
<?php |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
/** |
|
|
* simple Javascript Cloaking |
|
|
* email cloacking |
|
|
* by default replaces an email with a mailto link with email cloacked |
|
|
*/ |
|
|
function emailCloaking( $mail, $mailto=1, $text='', $email=1 ) { |
|
|
// convert text |
|
|
$mail = mosHTML::encoding_converter( $mail ); |
|
|
// split email by @ symbol |
|
|
$mail = explode( '@', $mail ); |
|
|
$mail_parts = explode( '.', $mail[1] ); |
|
|
// random number |
|
|
$rand = rand( 1, 100000 ); |
|
|
|
|
|
$replacement = "\n<script language='JavaScript' type='text/javascript'> \n"; |
|
|
$replacement .= "<!-- \n"; |
|
|
$replacement .= "var prefix = 'ma' + 'il' + 'to'; \n"; |
|
|
$replacement .= "var path = 'hr' + 'ef' + '='; \n"; |
|
|
$replacement .= "var addy". $rand ." = '". @$mail[0] ."' + '@' + '". implode( "' + '.' + '", $mail_parts ) ."'; \n"; |
|
|
if ( $mailto ) { |
|
|
// special handling when mail text is different from mail addy |
|
|
if ( $text ) { |
|
|
if ( $email ) { |
|
|
// convert text |
|
|
$text = mosHTML::encoding_converter( $text ); |
|
|
// split email by @ symbol |
|
|
$text = explode( '@', $text ); |
|
|
$text_parts = explode( '.', $text[1] ); |
|
|
$replacement .= "var addy_text". $rand ." = '". @$text[0] ."' + '@' + '". implode( "' + '.' + '", @$text_parts ) ."'; \n"; |
|
|
} else { |
|
|
$text = mosHTML::encoding_converter( $text ); |
|
|
$replacement .= "var addy_text". $rand ." = '". $text ."';\n"; |
|
|
} |
|
|
$replacement .= "document.write( '<a ' + path + '\'' + prefix + ':' + addy". $rand ." + '\'>' ); \n"; |
|
|
$replacement .= "document.write( addy_text". $rand ." ); \n"; |
|
|
$replacement .= "document.write( '<\/a>' ); \n"; |
|
|
} else { |
|
|
$replacement .= "document.write( '<a ' + path + '\'' + prefix + ':' + addy". $rand ." + '\'>' ); \n"; |
|
|
$replacement .= "document.write( addy". $rand ." ); \n"; |
|
|
$replacement .= "document.write( '<\/a>' ); \n"; |
|
|
} |
|
|
} else { |
|
|
$replacement .= "document.write( addy". $rand ." ); \n"; |
|
|
} |
|
|
$replacement .= "//--> \n"; |
|
|
$replacement .= "</script> \n"; |
|
|
$replacement .= "<noscript> \n"; |
|
|
$replacement .= _CLOAKING; |
|
|
$replacement .= "\n</noscript> \n"; |
|
|
|
|
|
return $replacement; |
|
|
} |
|
|
|
|
|
function encoding_converter( $text ) { |
|
|
// replace vowels with character encoding |
|
|
$text = str_replace( 'a', 'a', $text ); |
|
|
$text = str_replace( 'e', 'e', $text ); |
|
|
$text = str_replace( 'i', 'i', $text ); |
|
|
$text = str_replace( 'o', 'o', $text ); |
|
|
$text = str_replace( 'u', 'u', $text ); |
|
|
|
|
|
return $text; |
|
|
} |
|
|
} |
|
|
|
|
|
/** |
|
| 372 |
* Category database table class |
* Category database table class |
| 373 |
* @package Mambo |
* @package Mambo |
| 374 |
*/ |
*/ |
| 801 |
} |
} |
| 802 |
|
|
| 803 |
|
|
|
class mosCommonHTML { |
|
|
|
|
|
function ContentLegend( ) { |
|
|
?> |
|
|
<table cellspacing="0" cellpadding="4" border="0" align="center"> |
|
|
<tr align="center"> |
|
|
<td> |
|
|
<img src="images/publish_y.png" width="12" height="12" border="0" alt="Pending" /> |
|
|
</td> |
|
|
<td> |
|
|
Published, but is <u>Pending</u> | |
|
|
</td> |
|
|
<td> |
|
|
<img src="images/publish_g.png" width="12" height="12" border="0" alt="Visible" /> |
|
|
</td> |
|
|
<td> |
|
|
Published and is <u>Current</u> | |
|
|
</td> |
|
|
<td> |
|
|
<img src="images/publish_r.png" width="12" height="12" border="0" alt="Finished" /> |
|
|
</td> |
|
|
<td> |
|
|
Published, but has <u>Expired</u> | |
|
|
</td> |
|
|
<td> |
|
|
<img src="images/publish_x.png" width="12" height="12" border="0" alt="Finished" /> |
|
|
</td> |
|
|
<td> |
|
|
Not Published |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td colspan="8" align="center"> |
|
|
Click on icon to toggle state. |
|
|
</td> |
|
|
</tr> |
|
|
</table> |
|
|
<?php |
|
|
} |
|
|
|
|
|
function menuLinksContent( &$menus ) { |
|
|
?> |
|
|
<script language="javascript" type="text/javascript"> |
|
|
function go2( pressbutton, menu, id ) { |
|
|
var form = document.adminForm; |
|
|
|
|
|
if (pressbutton == 'go2menu') { |
|
|
form.menu.value = menu; |
|
|
submitform( pressbutton ); |
|
|
return; |
|
|
} |
|
|
|
|
|
if (pressbutton == 'go2menuitem') { |
|
|
form.menu.value = menu; |
|
|
form.menuid.value = id; |
|
|
submitform( pressbutton ); |
|
|
return; |
|
|
} |
|
|
} |
|
|
</script> |
|
|
<?php |
|
|
foreach( $menus as $menu ) { |
|
|
?> |
|
|
<tr> |
|
|
<td colspan="2"> |
|
|
<hr /> |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td width="90px" valign="top"> |
|
|
Menu |
|
|
</td> |
|
|
<td> |
|
|
<a href="javascript:go2( 'go2menu', '<?php echo $menu->menutype; ?>' );" title="Go to Menu"> |
|
|
<?php echo $menu->menutype; ?> |
|
|
</a> |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td width="90px" valign="top"> |
|
|
Link Name |
|
|
</td> |
|
|
<td> |
|
|
<strong> |
|
|
<a href="javascript:go2( 'go2menuitem', '<?php echo $menu->menutype; ?>', '<?php echo $menu->id; ?>' );" title="Go to Menu Item"> |
|
|
<?php echo $menu->name; ?> |
|
|
</a> |
|
|
</strong> |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td width="90px" valign="top"> |
|
|
State |
|
|
</td> |
|
|
<td> |
|
|
<?php |
|
|
switch ( $menu->published ) { |
|
|
case -2: |
|
|
echo '<font color="red">Trashed</font>'; |
|
|
break; |
|
|
case 0: |
|
|
echo 'UnPublished'; |
|
|
break; |
|
|
case 1: |
|
|
default: |
|
|
echo '<font color="green">Published</font>'; |
|
|
break; |
|
|
} |
|
|
?> |
|
|
</td> |
|
|
</tr> |
|
|
<?php |
|
|
} |
|
|
?> |
|
|
<input type="hidden" name="menu" value="" /> |
|
|
<input type="hidden" name="menuid" value="" /> |
|
|
<?php |
|
|
} |
|
|
|
|
|
function menuLinksSecCat( &$menus ) { |
|
|
?> |
|
|
<script language="javascript" type="text/javascript"> |
|
|
function go2( pressbutton, menu, id ) { |
|
|
var form = document.adminForm; |
|
|
|
|
|
if (pressbutton == 'go2menu') { |
|
|
form.menu.value = menu; |
|
|
submitform( pressbutton ); |
|
|
return; |
|
|
} |
|
|
|
|
|
if (pressbutton == 'go2menuitem') { |
|
|
form.menu.value = menu; |
|
|
form.menuid.value = id; |
|
|
submitform( pressbutton ); |
|
|
return; |
|
|
} |
|
|
} |
|
|
</script> |
|
|
<?php |
|
|
foreach( $menus as $menu ) { |
|
|
?> |
|
|
<tr> |
|
|
<td colspan="2"> |
|
|
<hr/> |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td width="90px" valign="top"> |
|
|
Menu |
|
|
</td> |
|
|
<td> |
|
|
<a href="javascript:go2( 'go2menu', '<?php echo $menu->menutype; ?>' );" title="Go to Menu"> |
|
|
<?php echo $menu->menutype; ?> |
|
|
</a> |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td width="90px" valign="top"> |
|
|
Type |
|
|
</td> |
|
|
<td> |
|
|
<?php echo $menu->type; ?> |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td width="90px" valign="top"> |
|
|
Item Name |
|
|
</td> |
|
|
<td> |
|
|
<strong> |
|
|
<a href="javascript:go2( 'go2menuitem', '<?php echo $menu->menutype; ?>', '<?php echo $menu->id; ?>' );" title="Go to Menu Item"> |
|
|
<?php echo $menu->name; ?> |
|
|
</a> |
|
|
</strong> |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td width="90px" valign="top"> |
|
|
State |
|
|
</td> |
|
|
<td> |
|
|
<?php |
|
|
switch ( $menu->published ) { |
|
|
case -2: |
|
|
echo '<font color="red">Trashed</font>'; |
|
|
break; |
|
|
case 0: |
|
|
echo 'UnPublished'; |
|
|
break; |
|
|
case 1: |
|
|
default: |
|
|
echo '<font color="green">Published</font>'; |
|
|
break; |
|
|
} |
|
|
?> |
|
|
</td> |
|
|
</tr> |
|
|
<?php |
|
|
} |
|
|
?> |
|
|
<input type="hidden" name="menu" value="" /> |
|
|
<input type="hidden" name="menuid" value="" /> |
|
|
<?php |
|
|
} |
|
|
|
|
|
function checkedOut( &$row, $overlib=1 ) { |
|
|
$hover = ''; |
|
|
if ( $overlib ) { |
|
|
$date = mosFormatDate( $row->checked_out_time, '%A, %d %B %Y' ); |
|
|
$time = mosFormatDate( $row->checked_out_time, '%H:%M' ); |
|
|
$checked_out_text = '<table>'; |
|
|
$checked_out_text .= '<tr><td>'. $row->editor .'</td></tr>'; |
|
|
$checked_out_text .= '<tr><td>'. $date .'</td></tr>'; |
|
|
$checked_out_text .= '<tr><td>'. $time .'</td></tr>'; |
|
|
$checked_out_text .= '</table>'; |
|
|
$hover = 'onMouseOver="return overlib(\''. $checked_out_text .'\', CAPTION, \'Checked Out\', BELOW, RIGHT);" onMouseOut="return nd();"'; |
|
|
} |
|
|
$checked = '<img src="images/checked_out.png" '. $hover .'/>'; |
|
|
|
|
|
return $checked; |
|
|
} |
|
|
|
|
|
/* |
|
|
* Loads all necessary files for JS Overlib tooltips |
|
|
*/ |
|
|
function loadOverlib() { |
|
|
global $mosConfig_live_site; |
|
|
?> |
|
|
<script language="Javascript" src="<?php echo $mosConfig_live_site;?>/includes/js/overlib_mini.js"></script> |
|
|
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div> |
|
|
<?php |
|
|
} |
|
|
|
|
|
|
|
|
/* |
|
|
* Loads all necessary files for JS Calendar |
|
|
*/ |
|
|
function loadCalendar() { |
|
|
global $mosConfig_live_site; |
|
|
?> |
|
|
<link rel="stylesheet" type="text/css" media="all" href="<?php echo $mosConfig_live_site;?>/includes/js/calendar/calendar-mos.css" title="green" /> |
|
|
<!-- import the calendar script --> |
|
|
<script type="text/javascript" src="<?php echo $mosConfig_live_site;?>/includes/js/calendar/calendar.js"></script> |
|
|
<!-- import the language module --> |
|
|
<script type="text/javascript" src="<?php echo $mosConfig_live_site;?>/includes/js/calendar/lang/calendar-en.js"></script> |
|
|
<?php |
|
|
} |
|
|
|
|
|
function AccessProcessing( &$row, $i ) { |
|
|
if ( !$row->access ) { |
|
|
$color_access = 'style="color: green;"'; |
|
|
$task_access = 'accessregistered'; |
|
|
} else if ( $row->access == 1 ) { |
|
|
$color_access = 'style="color: red;"'; |
|
|
$task_access = 'accessspecial'; |
|
|
} else { |
|
|
$color_access = 'style="color: black;"'; |
|
|
$task_access = 'accesspublic'; |
|
|
} |
|
|
|
|
|
$href = ' |
|
|
<a href="javascript: void(0);" onclick="return listItemTask(\'cb'. $i .'\',\''. $task_access .'\')" '. $color_access .'> |
|
|
'. $row->groupname .' |
|
|
</a>' |
|
|
; |
|
|
|
|
|
return $href; |
|
|
} |
|
|
|
|
|
function CheckedOutProcessing( &$row, $i ) { |
|
|
global $my; |
|
|
|
|
|
if ( $row->checked_out ) { |
|
|
$checked = mosCommonHTML::checkedOut( $row ); |
|
|
} else { |
|
|
$checked = mosHTML::idBox( $i, $row->id, ($row->checked_out && $row->checked_out != $my->id ) ); |
|
|
} |
|
|
|
|
|
return $checked; |
|
|
} |
|
|
|
|
|
function PublishedProcessing( &$row, $i ) { |
|
|
$img = $row->published ? 'publish_g.png' : 'publish_x.png'; |
|
|
$task = $row->published ? 'unpublish' : 'publish'; |
|
|
$alt = $row->published ? 'Published' : 'Unpublished'; |
|
|
$action = $row->published ? 'Unpublish Item' : 'Publish item'; |
|
|
|
|
|
$href = ' |
|
|
<a href="javascript: void(0);" onclick="return listItemTask(\'cb'. $i .'\',\''. $task .'\')" title="'. $action .'"> |
|
|
<img src="images/'. $img .'" border="0" alt="'. $alt .'" /> |
|
|
</a>' |
|
|
; |
|
|
|
|
|
return $href; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
| 804 |
// ----- NO MORE CLASSES OR FUNCTIONS PASSED THIS POINT ----- |
// ----- NO MORE CLASSES OR FUNCTIONS PASSED THIS POINT ----- |
| 805 |
// Post class declaration initialisations |
// Post class declaration initialisations |
| 806 |
// some version of PHP don't allow the instantiation of classes |
// some version of PHP don't allow the instantiation of classes |