| 1 |
<?php |
<?php |
| 2 |
/** |
/** |
| 3 |
* @version $Id: mambo.php,v 1.14 2005/11/14 21:56:04 eliasan Exp $ |
* @version $Id: mambo.php,v 1.14 2005/11/14 21:56:04 eliasan Exp $ |
| 4 |
* @package Mambo |
* @package Mambo With admin Language Pack for 4.5.3 by datahellas |
| 5 |
* @copyright (C) 2000 - 2005 Miro International Pty Ltd |
* @copyright (C) 2000 - 2005 Miro International Pty Ltd |
| 6 |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
| 7 |
* Mambo is Free Software |
* Mambo is Free Software |
| 38 |
$image_path = $mosConfig_absolute_path.'/images/stories'; |
$image_path = $mosConfig_absolute_path.'/images/stories'; |
| 39 |
$image_size = 100; |
$image_size = 100; |
| 40 |
|
|
| 41 |
require_once( $mosConfig_absolute_path . '/includes/version.php' ); |
require_once( $mosConfig_absolute_path . "/includes/version.php" ); |
| 42 |
require_once( $mosConfig_absolute_path . '/includes/database.php' ); |
require_once( $mosConfig_absolute_path . "/includes/database.php" ); |
| 43 |
require_once( $mosConfig_absolute_path . '/includes/gacl.class.php' ); |
require_once( $mosConfig_absolute_path . "/includes/gacl.class.php" ); |
| 44 |
require_once( $mosConfig_absolute_path . '/includes/gacl_api.class.php' ); |
require_once( $mosConfig_absolute_path . "/includes/gacl_api.class.php" ); |
| 45 |
require_once( $mosConfig_absolute_path . '/includes/phpmailer/class.phpmailer.php' ); |
require_once( $mosConfig_absolute_path . "/includes/phpmailer/class.phpmailer.php" ); |
| 46 |
require_once( $mosConfig_absolute_path . '/includes/mamboxml.php' ); |
require_once( $mosConfig_absolute_path . "/includes/mamboxml.php" ); |
| 47 |
require_once( $mosConfig_absolute_path . '/includes/phpInputFilter/class.inputfilter.php' ); |
require_once( $mosConfig_absolute_path . "/includes/phpInputFilter/class.inputfilter.php" ); |
| 48 |
|
|
| 49 |
/** |
/** |
| 50 |
* Task routing class |
* Task routing class |
| 449 |
$remember = trim( mosGetParam( $_POST, 'remember', '' ) ); |
$remember = trim( mosGetParam( $_POST, 'remember', '' ) ); |
| 450 |
|
|
| 451 |
if (!$username || !$passwd) { |
if (!$username || !$passwd) { |
| 452 |
echo "<script> alert(\""._LOGIN_INCOMPLETE."\"); window.history.go(-1); </script>\n"; |
echo "<script> alert(\"".T_('Please complete the username and password fields.')."\"); window.history.go(-1); </script>\n"; |
| 453 |
exit(); |
exit(); |
| 454 |
} else { |
} else { |
| 455 |
$this->_db->setQuery( "SELECT id, gid, block, usertype" |
$this->_db->setQuery( "SELECT id, gid, block, usertype" |
| 459 |
$row = null; |
$row = null; |
| 460 |
if ($this->_db->loadObject( $row )) { |
if ($this->_db->loadObject( $row )) { |
| 461 |
if ($row->block == 1) { |
if ($row->block == 1) { |
| 462 |
echo "<script>alert(\""._LOGIN_BLOCKED."\"); window.history.go(-1); </script>\n"; |
echo "<script>alert(\"".T_('Your login has been blocked. Please contact the administrator.')."\"); window.history.go(-1); </script>\n"; |
| 463 |
exit(); |
exit(); |
| 464 |
} |
} |
| 465 |
// fudge the group stuff |
// fudge the group stuff |
| 498 |
mosCache::cleanCache(); |
mosCache::cleanCache(); |
| 499 |
} else { |
} else { |
| 500 |
if (isset($bypost)) { |
if (isset($bypost)) { |
| 501 |
echo "<script>alert(\""._LOGIN_INCORRECT."\"); window.history.go(-1); </script>\n"; |
echo "<script>alert(\"".T_('Incorrect username or password. Please try again.')."\"); window.history.go(-1); </script>\n"; |
| 502 |
} else { |
} else { |
| 503 |
$this->logout(); |
$this->logout(); |
| 504 |
mosRedirect("index.php"); |
mosRedirect("index.php"); |
| 532 |
setcookie( "usercookie", " ", $lifetime, "/" ); |
setcookie( "usercookie", " ", $lifetime, "/" ); |
| 533 |
@session_destroy(); |
@session_destroy(); |
| 534 |
} |
} |
| 535 |
|
|
| 536 |
/** |
/** |
| 537 |
* @return mosUser A user object with the information from the current session |
* @return mosUser A user object with the information from the current session |
| 538 |
*/ |
*/ |
| 590 |
$this->_config->multipage_toc = $mosConfig_multipage_toc; |
$this->_config->multipage_toc = $mosConfig_multipage_toc; |
| 591 |
$this->_config->allowUserRegistration = $mosConfig_allowUserRegistration; |
$this->_config->allowUserRegistration = $mosConfig_allowUserRegistration; |
| 592 |
$this->_config->error_reporting = $mosConfig_error_reporting; |
$this->_config->error_reporting = $mosConfig_error_reporting; |
| 593 |
|
$this->_config->mosConfig_register_globals = $mosConfig_register_globals; |
| 594 |
$this->_config->link_titles = $mosConfig_link_titles; |
$this->_config->link_titles = $mosConfig_link_titles; |
| 595 |
$this->_config->list_limit = $mosConfig_list_limit; |
$this->_config->list_limit = $mosConfig_list_limit; |
| 596 |
$this->_config->caching = $mosConfig_caching; |
$this->_config->caching = $mosConfig_caching; |
| 1084 |
echo '<tr>'; |
echo '<tr>'; |
| 1085 |
echo '<td class="item">' . $folder . '/</td>'; |
echo '<td class="item">' . $folder . '/</td>'; |
| 1086 |
echo '<td align="left">'; |
echo '<td align="left">'; |
| 1087 |
echo is_writable( "../$folder" ) ? '<b><font color="green">Writeable</font></b>' : '<b><font color="red">Unwriteable</font></b>' . '</td>'; |
echo is_writable( "../$folder" ) ? '<b><font color="green">'.T_('Writeable').'</font></b>' : '<b><font color="red">'.T_('Unwriteable').'</font></b>' . '</td>'; |
| 1088 |
echo '</tr>'; |
echo '</tr>'; |
| 1089 |
} |
} |
| 1090 |
|
|
| 1158 |
*/ |
*/ |
| 1159 |
function monthSelectList( $tag_name, $tag_attribs, $selected ) { |
function monthSelectList( $tag_name, $tag_attribs, $selected ) { |
| 1160 |
$arr = array( |
$arr = array( |
| 1161 |
mosHTML::makeOption( '01', _JAN ), |
mosHTML::makeOption( '01', T_('January') ), |
| 1162 |
mosHTML::makeOption( '02', _FEB ), |
mosHTML::makeOption( '02', T_('February') ), |
| 1163 |
mosHTML::makeOption( '03', _MAR ), |
mosHTML::makeOption( '03', T_('March') ), |
| 1164 |
mosHTML::makeOption( '04', _APR ), |
mosHTML::makeOption( '04', T_('April') ), |
| 1165 |
mosHTML::makeOption( '05', _MAY ), |
mosHTML::makeOption( '05', T_('May') ), |
| 1166 |
mosHTML::makeOption( '06', _JUN ), |
mosHTML::makeOption( '06', T_('June') ), |
| 1167 |
mosHTML::makeOption( '07', _JUL ), |
mosHTML::makeOption( '07', T_('July') ), |
| 1168 |
mosHTML::makeOption( '08', _AUG ), |
mosHTML::makeOption( '08', T_('August') ), |
| 1169 |
mosHTML::makeOption( '09', _SEP ), |
mosHTML::makeOption( '09', T_('September') ), |
| 1170 |
mosHTML::makeOption( '10', _OCT ), |
mosHTML::makeOption( '10', T_('October') ), |
| 1171 |
mosHTML::makeOption( '11', _NOV ), |
mosHTML::makeOption( '11', T_('November') ), |
| 1172 |
mosHTML::makeOption( '12', _DEC ) |
mosHTML::makeOption( '12', T_('December') ) |
| 1173 |
); |
); |
| 1174 |
|
|
| 1175 |
return mosHTML::selectList( $arr, $tag_name, $tag_attribs, 'value', 'text', $selected ); |
return mosHTML::selectList( $arr, $tag_name, $tag_attribs, 'value', 'text', $selected ); |
| 1228 |
* @param mixed The key that is selected |
* @param mixed The key that is selected |
| 1229 |
* @returns string HTML for the select list values |
* @returns string HTML for the select list values |
| 1230 |
*/ |
*/ |
| 1231 |
function yesnoSelectList( $tag_name, $tag_attribs, $selected, $yes=_CMN_YES, $no=_CMN_NO ) { |
function yesnoSelectList( $tag_name, $tag_attribs, $selected, $yes=null, $no=null ) { |
| 1232 |
|
// modified by csouza for gettext localization |
| 1233 |
|
if (is_null($yes)) $yes = T_('Yes'); |
| 1234 |
|
if (is_null($yes)) $no = T_('No'); |
| 1235 |
|
|
| 1236 |
$arr = array( |
$arr = array( |
| 1237 |
mosHTML::makeOption( '0', $no ), |
mosHTML::makeOption( '0', $no ), |
| 1238 |
mosHTML::makeOption( '1', $yes ), |
mosHTML::makeOption( '1', $yes ), |
| 1285 |
* @param mixed The key that is selected |
* @param mixed The key that is selected |
| 1286 |
* @returns string HTML for the radio list |
* @returns string HTML for the radio list |
| 1287 |
*/ |
*/ |
| 1288 |
function yesnoRadioList( $tag_name, $tag_attribs, $selected, $yes=_CMN_YES, $no=_CMN_NO ) { |
function yesnoRadioList( $tag_name, $tag_attribs, $selected, $yes=null, $no=null ) { |
| 1289 |
|
// modified by csouza for gettext localization |
| 1290 |
|
if (is_null($yes)) $yes = T_('Yes'); |
| 1291 |
|
if (is_null($yes)) $no = T_('No'); |
| 1292 |
|
|
| 1293 |
$arr = array( |
$arr = array( |
| 1294 |
mosHTML::makeOption( '0', $no, true ), |
mosHTML::makeOption( '0', $no, true ), |
| 1295 |
mosHTML::makeOption( '1', $yes, true ) |
mosHTML::makeOption( '1', $yes, true ) |
| 1316 |
global $mosConfig_live_site; |
global $mosConfig_live_site; |
| 1317 |
|
|
| 1318 |
$alts = array( |
$alts = array( |
| 1319 |
'none' => _CMN_SORT_NONE, |
'none' => T_('No Sorting'), |
| 1320 |
'asc' => _CMN_SORT_ASC, |
'asc' => T_('Sort Ascending'), |
| 1321 |
'desc' => _CMN_SORT_DESC, |
'desc' => T_('Sort Descending'), |
| 1322 |
); |
); |
| 1323 |
$next_state = 'asc'; |
$next_state = 'asc'; |
| 1324 |
if ($state == 'asc') { |
if ($state == 'asc') { |
| 1343 |
<div align="center" style="margin-top: 30px; margin-bottom: 30px;"> |
<div align="center" style="margin-top: 30px; margin-bottom: 30px;"> |
| 1344 |
<a href='javascript:window.close();'> |
<a href='javascript:window.close();'> |
| 1345 |
<span class="small"> |
<span class="small"> |
| 1346 |
<?php echo _PROMPT_CLOSE;?> |
<?php echo T_('Close Window');?> |
| 1347 |
</span> |
</span> |
| 1348 |
</a> |
</a> |
| 1349 |
</div> |
</div> |
| 1360 |
?> |
?> |
| 1361 |
<div class="back_button"> |
<div class="back_button"> |
| 1362 |
<a href='javascript:history.go(-1)'> |
<a href='javascript:history.go(-1)'> |
| 1363 |
<?php echo _BACK; ?> |
<?php echo '['.T_('Back').']'; ?> |
| 1364 |
</a> |
</a> |
| 1365 |
</div> |
</div> |
| 1366 |
<?php |
<?php |
| 1396 |
|
|
| 1397 |
// checks template image directory for image, if non found default are loaded |
// checks template image directory for image, if non found default are loaded |
| 1398 |
if ( $params->get( 'icons' ) ) { |
if ( $params->get( 'icons' ) ) { |
| 1399 |
$image = mosAdminMenus::ImageCheck( 'printButton.png', '/images/M_images/', NULL, NULL, _CMN_PRINT ); |
$image = mosAdminMenus::ImageCheck( 'printButton.png', '/images/M_images/', NULL, NULL, T_('Print') ); |
| 1400 |
} else { |
} else { |
| 1401 |
$image = _ICON_SEP .' '. _CMN_PRINT. ' '. _ICON_SEP; |
$image = _ICON_SEP .' '. T_('Print'). ' '. _ICON_SEP; |
| 1402 |
} |
} |
| 1403 |
|
|
| 1404 |
if ( $params->get( 'popup' ) && !$hide_js ) { |
if ( $params->get( 'popup' ) && !$hide_js ) { |
| 1405 |
// Print Preview button - used when viewing page |
// Print Preview button - used when viewing page |
| 1406 |
?> |
?> |
| 1407 |
<td align="right" width="100%" class="buttonheading"> |
<td align="right" width="100%" class="buttonheading"> |
| 1408 |
<a href="#" onclick="javascript:window.print(); return false" title="<?php echo _CMN_PRINT;?>"> |
<a href="#" onclick="javascript:window.print(); return false" title="<?php echo T_('Print');?>"> |
| 1409 |
<?php echo $image;?> |
<?php echo $image;?> |
| 1410 |
</a> |
</a> |
| 1411 |
</td> |
</td> |
| 1414 |
// Print Button - used in pop-up window |
// Print Button - used in pop-up window |
| 1415 |
?> |
?> |
| 1416 |
<td align="right" width="100%" class="buttonheading"> |
<td align="right" width="100%" class="buttonheading"> |
| 1417 |
<a href="javascript:void window.open('<?php echo $link; ?>', 'win2', '<?php echo $status; ?>');" title="<?php echo _CMN_PRINT;?>"> |
<a href="javascript:void window.open('<?php echo $link; ?>', 'win2', '<?php echo $status; ?>');" title="<?php echo T_('Print');?>"> |
| 1418 |
<?php echo $image;?> |
<?php echo $image;?> |
| 1419 |
</a> |
</a> |
| 1420 |
</td> |
</td> |
| 1470 |
$replacement .= "//--> \n"; |
$replacement .= "//--> \n"; |
| 1471 |
$replacement .= "</script> \n"; |
$replacement .= "</script> \n"; |
| 1472 |
$replacement .= "<noscript> \n"; |
$replacement .= "<noscript> \n"; |
| 1473 |
$replacement .= _CLOAKING; |
$replacement .= T_('This email address is being protected from spam bots, you need Javascript enabled to view it'); |
| 1474 |
$replacement .= "\n</noscript> \n"; |
$replacement .= "\n</noscript> \n"; |
| 1475 |
|
|
| 1476 |
return $replacement; |
return $replacement; |
| 1530 |
function check() { |
function check() { |
| 1531 |
// check for valid name |
// check for valid name |
| 1532 |
if (trim( $this->title ) == '') { |
if (trim( $this->title ) == '') { |
| 1533 |
$this->_error = "Your Category must contain a title."; |
$this->_error = T_("Your Category must contain a title."); |
| 1534 |
return false; |
return false; |
| 1535 |
} |
} |
| 1536 |
if (trim( $this->name ) == '') { |
if (trim( $this->name ) == '') { |
| 1537 |
$this->_error = "Your Category must have a name."; |
$this->_error = T_("Your Category must have a name."); |
| 1538 |
return false; |
return false; |
| 1539 |
} |
} |
| 1540 |
// check for existing name |
// check for existing name |
| 1544 |
|
|
| 1545 |
$xid = intval( $this->_db->loadResult() ); |
$xid = intval( $this->_db->loadResult() ); |
| 1546 |
if ($xid && $xid != intval( $this->id )) { |
if ($xid && $xid != intval( $this->id )) { |
| 1547 |
$this->_error = "There is a category already with that name, please try again."; |
$this->_error = T_("There is a category already with that name, please try again."); |
| 1548 |
return false; |
return false; |
| 1549 |
} |
} |
| 1550 |
return true; |
return true; |
| 1593 |
function check() { |
function check() { |
| 1594 |
// check for valid name |
// check for valid name |
| 1595 |
if (trim( $this->title ) == '') { |
if (trim( $this->title ) == '') { |
| 1596 |
$this->_error = "Your Section must contain a title."; |
$this->_error = T_("Your Section must contain a title."); |
| 1597 |
return false; |
return false; |
| 1598 |
} |
} |
| 1599 |
if (trim( $this->name ) == '') { |
if (trim( $this->name ) == '') { |
| 1600 |
$this->_error = "Your Section must have a name."; |
$this->_error = T_("Your Section must have a name."); |
| 1601 |
return false; |
return false; |
| 1602 |
} |
} |
| 1603 |
// check for existing name |
// check for existing name |
| 1607 |
|
|
| 1608 |
$xid = intval( $this->_db->loadResult() ); |
$xid = intval( $this->_db->loadResult() ); |
| 1609 |
if ($xid && $xid != intval( $this->id )) { |
if ($xid && $xid != intval( $this->id )) { |
| 1610 |
$this->_error = "There is a section already with that name, please try again."; |
$this->_error = T_("There is a section already with that name, please try again."); |
| 1611 |
return false; |
return false; |
| 1612 |
} |
} |
| 1613 |
return true; |
return true; |
| 1838 |
|
|
| 1839 |
// Validate user information |
// Validate user information |
| 1840 |
if (trim( $this->name ) == '') { |
if (trim( $this->name ) == '') { |
| 1841 |
$this->_error = _REGWARN_NAME; |
$this->_error = T_('Please enter your name.'); |
| 1842 |
return false; |
return false; |
| 1843 |
} |
} |
| 1844 |
|
|
| 1845 |
if (trim( $this->username ) == '') { |
if (trim( $this->username ) == '') { |
| 1846 |
$this->_error = _REGWARN_UNAME; |
$this->_error = T_('Please enter a user name.'); |
| 1847 |
return false; |
return false; |
| 1848 |
} |
} |
| 1849 |
|
|
| 1850 |
if (eregi( "[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", $this->username) || strlen( $this->username ) < 3) { |
if (eregi( "[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", $this->username) || strlen( $this->username ) < 3) { |
| 1851 |
$this->_error = sprintf( _VALID_AZ09, _PROMPT_UNAME, 2 ); |
$this->_error = sprintf( T_("Please enter a valid %s. No spaces, more than %d characters and containing only the characters 0-9,a-z, or A-Z"), T_('Username:'), 2 ); |
| 1852 |
return false; |
return false; |
| 1853 |
} |
} |
| 1854 |
|
|
| 1855 |
if ((trim($this->email == "")) || (preg_match("/[\w\.\-]+@\w+[\w\.\-]*?\.\w{1,4}/", $this->email )==false)) { |
if ((trim($this->email == "")) || (preg_match("/[\w\.\-]+@\w+[\w\.\-]*?\.\w{1,4}/", $this->email )==false)) { |
| 1856 |
$this->_error = _REGWARN_MAIL; |
$this->_error = T_('Please enter a valid e-mail address.'); |
| 1857 |
return false; |
return false; |
| 1858 |
} |
} |
| 1859 |
|
|
| 1864 |
|
|
| 1865 |
$xid = intval( $this->_db->loadResult() ); |
$xid = intval( $this->_db->loadResult() ); |
| 1866 |
if ($xid && $xid != intval( $this->id )) { |
if ($xid && $xid != intval( $this->id )) { |
| 1867 |
$this->_error = _REGWARN_INUSE; |
$this->_error = T_('This username/password is already in use. Please try another.'); |
| 1868 |
return false; |
return false; |
| 1869 |
} |
} |
| 1870 |
|
|
| 1876 |
|
|
| 1877 |
$xid = intval( $this->_db->loadResult() ); |
$xid = intval( $this->_db->loadResult() ); |
| 1878 |
if ($xid && $xid != intval( $this->id )) { |
if ($xid && $xid != intval( $this->id )) { |
| 1879 |
$this->_error = _REGWARN_EMAIL_INUSE; |
$this->_error = T_('This e-mail is already registered. If you forgot the password click on "Password Reminder" and new password will be sent to you.'); |
| 1880 |
return false; |
return false; |
| 1881 |
} |
} |
| 1882 |
} |
} |
| 2315 |
$ret = $this->_db->insertObject( $this->_tbl, $this ); |
$ret = $this->_db->insertObject( $this->_tbl, $this ); |
| 2316 |
|
|
| 2317 |
if( !$ret ) { |
if( !$ret ) { |
| 2318 |
$this->_error = strtolower(get_class( $this ))."::store failed <br />" . $this->_db->stderr(); |
$this->_error = strtolower(get_class( $this ))."::store() ". T_('failed') ." <br />" . $this->_db->stderr(); |
| 2319 |
return false; |
return false; |
| 2320 |
} else { |
} else { |
| 2321 |
return true; |
return true; |
| 2326 |
$ret = $this->_db->updateObject( $this->_tbl, $this, 'session_id', $updateNulls ); |
$ret = $this->_db->updateObject( $this->_tbl, $this, 'session_id', $updateNulls ); |
| 2327 |
|
|
| 2328 |
if( !$ret ) { |
if( !$ret ) { |
| 2329 |
$this->_error = strtolower(get_class( $this ))."::store failed <br />" . $this->_db->stderr(); |
$this->_error = strtolower(get_class( $this ))."::store() ". T_('failed') ." <br />" . $this->_db->stderr(); |
| 2330 |
return false; |
return false; |
| 2331 |
} else { |
} else { |
| 2332 |
return true; |
return true; |
| 3076 |
); |
); |
| 3077 |
$ordering = mosHTML::selectList( $order, 'ordering', 'class="inputbox" size="1"', 'value', 'text', intval( $row->ordering ) ); |
$ordering = mosHTML::selectList( $order, 'ordering', 'class="inputbox" size="1"', 'value', 'text', intval( $row->ordering ) ); |
| 3078 |
} else { |
} else { |
| 3079 |
$ordering = '<input type="hidden" name="ordering" value="'. $row->ordering .'" />'. _CMN_NEW_ITEM_LAST; |
$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.'); |
| 3080 |
} |
} |
| 3081 |
return $ordering; |
return $ordering; |
| 3082 |
} |
} |
| 3171 |
* build the select list for target window |
* build the select list for target window |
| 3172 |
*/ |
*/ |
| 3173 |
function Target( &$row ) { |
function Target( &$row ) { |
| 3174 |
$click[] = mosHTML::makeOption( '0', 'Parent Window With Browser Navigation' ); |
$click[] = mosHTML::makeOption( '0', T_('Parent Window With Browser Navigation') ); |
| 3175 |
$click[] = mosHTML::makeOption( '1', 'New Window With Browser Navigation' ); |
$click[] = mosHTML::makeOption( '1', T_('New Window With Browser Navigation') ); |
| 3176 |
$click[] = mosHTML::makeOption( '2', 'New Window Without Browser Navigation' ); |
$click[] = mosHTML::makeOption( '2', T_('New Window Without Browser Navigation') ); |
| 3177 |
$target = mosHTML::selectList( $click, 'browserNav', 'class="inputbox" size="4"', 'value', 'text', intval( $row->browserNav ) ); |
$target = mosHTML::selectList( $click, 'browserNav', 'class="inputbox" size="4"', 'value', 'text', intval( $row->browserNav ) ); |
| 3178 |
return $target; |
return $target; |
| 3179 |
} |
} |
| 3232 |
$mitems = array(); |
$mitems = array(); |
| 3233 |
if ( $all ) { |
if ( $all ) { |
| 3234 |
// prepare an array with 'all' as the first item |
// prepare an array with 'all' as the first item |
| 3235 |
$mitems[] = mosHTML::makeOption( 0, 'All' ); |
$mitems[] = mosHTML::makeOption( 0, T_('All') ); |
| 3236 |
// adds space, in select box which is not saved |
// adds space, in select box which is not saved |
| 3237 |
$mitems[] = mosHTML::makeOption( -999, '----' ); |
$mitems[] = mosHTML::makeOption( -999, '----' ); |
| 3238 |
} |
} |
| 3239 |
if ( $none ) { |
if ( $none ) { |
| 3240 |
// prepare an array with 'all' as the first item |
// prepare an array with 'all' as the first item |
| 3241 |
$mitems[] = mosHTML::makeOption( -999, 'None' ); |
$mitems[] = mosHTML::makeOption( -999, T_('None') ); |
| 3242 |
// adds space, in select box which is not saved |
// adds space, in select box which is not saved |
| 3243 |
$mitems[] = mosHTML::makeOption( -999, '----' ); |
$mitems[] = mosHTML::makeOption( -999, '----' ); |
| 3244 |
} |
} |
| 3294 |
; |
; |
| 3295 |
$database->setQuery( $query ); |
$database->setQuery( $query ); |
| 3296 |
if ( $all ) { |
if ( $all ) { |
| 3297 |
$rows[] = mosHTML::makeOption( 0, '- All Sections -' ); |
$rows[] = mosHTML::makeOption( 0, T_('- All Sections -') ); |
| 3298 |
$rows = array_merge( $rows, $database->loadObjectList() ); |
$rows = array_merge( $rows, $database->loadObjectList() ); |
| 3299 |
} else { |
} else { |
| 3300 |
$rows = $database->loadObjectList(); |
$rows = $database->loadObjectList(); |
| 3381 |
} |
} |
| 3382 |
|
|
| 3383 |
$imageFiles = mosReadDirectory( $mosConfig_absolute_path . $directory ); |
$imageFiles = mosReadDirectory( $mosConfig_absolute_path . $directory ); |
| 3384 |
$images = array( mosHTML::makeOption( '', '- Select Image -' ) ); |
$images = array( mosHTML::makeOption( '', T_('- Select Image -') ) ); |
| 3385 |
foreach ( $imageFiles as $file ) { |
foreach ( $imageFiles as $file ) { |
| 3386 |
if ( eregi( "bmp|gif|jpg|png", $file ) ) { |
if ( eregi( "bmp|gif|jpg|png", $file ) ) { |
| 3387 |
$images[] = mosHTML::makeOption( $file ); |
$images[] = mosHTML::makeOption( $file ); |
| 3399 |
global $database; |
global $database; |
| 3400 |
|
|
| 3401 |
if ( $neworder ) { |
if ( $neworder ) { |
| 3402 |
$text = _CMN_NEW_ITEM_FIRST; |
$text = T_('New items default to the first place. Ordering can be changed after this item is saved.'); |
| 3403 |
} else { |
} else { |
| 3404 |
$text = _CMN_NEW_ITEM_LAST; |
$text = T_('New items default to the last place. Ordering can be changed after this item is saved.'); |
| 3405 |
} |
} |
| 3406 |
|
|
| 3407 |
if ( $id ) { |
if ( $id ) { |
| 3426 |
; |
; |
| 3427 |
$database->setQuery( $query ); |
$database->setQuery( $query ); |
| 3428 |
if ( $nouser ) { |
if ( $nouser ) { |
| 3429 |
$users[] = mosHTML::makeOption( '0', '- No User -' ); |
$users[] = mosHTML::makeOption( '0', T_('- No User -') ); |
| 3430 |
$users = array_merge( $users, $database->loadObjectList() ); |
$users = array_merge( $users, $database->loadObjectList() ); |
| 3431 |
} else { |
} else { |
| 3432 |
$users = $database->loadObjectList(); |
$users = $database->loadObjectList(); |
| 3442 |
*/ |
*/ |
| 3443 |
function Positions( $name, $active=NULL, $javascript=NULL, $none=1, $center=1, $left=1, $right=1 ) { |
function Positions( $name, $active=NULL, $javascript=NULL, $none=1, $center=1, $left=1, $right=1 ) { |
| 3444 |
if ( $none ) { |
if ( $none ) { |
| 3445 |
$pos[] = mosHTML::makeOption( '', _CMN_NONE ); |
$pos[] = mosHTML::makeOption( '', T_('None') ); |
| 3446 |
} |
} |
| 3447 |
if ( $center ) { |
if ( $center ) { |
| 3448 |
$pos[] = mosHTML::makeOption( 'center', _CMN_CENTER ); |
$pos[] = mosHTML::makeOption( 'center', T_('Center') ); |
| 3449 |
} |
} |
| 3450 |
if ( $left ) { |
if ( $left ) { |
| 3451 |
$pos[] = mosHTML::makeOption( 'left', _CMN_LEFT ); |
$pos[] = mosHTML::makeOption( 'left', T_('Left') ); |
| 3452 |
} |
} |
| 3453 |
if ( $right ) { |
if ( $right ) { |
| 3454 |
$pos[] = mosHTML::makeOption( 'right', _CMN_RIGHT ); |
$pos[] = mosHTML::makeOption( 'right', T_('Right') ); |
| 3455 |
} |
} |
| 3456 |
|
|
| 3457 |
$positions = mosHTML::selectList( $pos, $name, 'class="inputbox" size="1"'. $javascript, 'value', 'text', $active ); |
$positions = mosHTML::selectList( $pos, $name, 'class="inputbox" size="1"'. $javascript, 'value', 'text', $active ); |
| 3473 |
; |
; |
| 3474 |
$database->setQuery( $query ); |
$database->setQuery( $query ); |
| 3475 |
if ( $sel_cat ) { |
if ( $sel_cat ) { |
| 3476 |
$categories[] = mosHTML::makeOption( '0', _SEL_CATEGORY ); |
$categories[] = mosHTML::makeOption( '0', T_('- All Categories -') ); |
| 3477 |
$categories = array_merge( $categories, $database->loadObjectList() ); |
$categories = array_merge( $categories, $database->loadObjectList() ); |
| 3478 |
} else { |
} else { |
| 3479 |
$categories = $database->loadObjectList(); |
$categories = $database->loadObjectList(); |
| 3480 |
} |
} |
| 3481 |
|
|
| 3482 |
if ( count( $categories ) < 1 ) { |
if ( count( $categories ) < 1 ) { |
| 3483 |
mosRedirect( 'index2.php?option=com_categories§ion='. $section, 'You must create a category first.' ); |
mosRedirect( 'index2.php?option=com_categories§ion='. $section, T_('You must create a category first.') ); |
| 3484 |
} |
} |
| 3485 |
|
|
| 3486 |
$category = mosHTML::selectList( $categories, $name, 'class="inputbox" size="'. $size .'" '. $javascript, 'value', 'text', $active ); |
$category = mosHTML::selectList( $categories, $name, 'class="inputbox" size="'. $size .'" '. $javascript, 'value', 'text', $active ); |
| 3494 |
function SelectSection( $name, $active=NULL, $javascript=NULL, $order='ordering' ) { |
function SelectSection( $name, $active=NULL, $javascript=NULL, $order='ordering' ) { |
| 3495 |
global $database; |
global $database; |
| 3496 |
|
|
| 3497 |
$categories[] = mosHTML::makeOption( '0', _SEL_SECTION ); |
$categories[] = mosHTML::makeOption( '0', T_('- All Sections -') ); |
| 3498 |
$query = "SELECT id AS value, title AS text" |
$query = "SELECT id AS value, title AS text" |
| 3499 |
. "\n FROM #__sections" |
. "\n FROM #__sections" |
| 3500 |
. "\n WHERE published = '1'" |
. "\n WHERE published = '1'" |
| 3769 |
<img src="images/publish_y.png" width="12" height="12" border="0" alt="Pending" /> |
<img src="images/publish_y.png" width="12" height="12" border="0" alt="Pending" /> |
| 3770 |
</td> |
</td> |
| 3771 |
<td> |
<td> |
| 3772 |
Published, but is <u>Pending</u> | |
<?php echo T_('Published, but is <u>Pending</u>') ?> | |
| 3773 |
</td> |
</td> |
| 3774 |
<td> |
<td> |
| 3775 |
<img src="images/publish_g.png" width="12" height="12" border="0" alt="Visible" /> |
<img src="images/publish_g.png" width="12" height="12" border="0" alt="Visible" /> |
| 3776 |
</td> |
</td> |
| 3777 |
<td> |
<td> |
| 3778 |
Published and is <u>Current</u> | |
<?php echo T_('Published and is <u>Current</u>') ?> | |
| 3779 |
</td> |
</td> |
| 3780 |
<td> |
<td> |
| 3781 |
<img src="images/publish_r.png" width="12" height="12" border="0" alt="Finished" /> |
<img src="images/publish_r.png" width="12" height="12" border="0" alt="Finished" /> |
| 3782 |
</td> |
</td> |
| 3783 |
<td> |
<td> |
| 3784 |
Published, but has <u>Expired</u> | |
<?php echo T_('Published, but has <u>Expired</u>') ?> | |
| 3785 |
</td> |
</td> |
| 3786 |
<td> |
<td> |
| 3787 |
<img src="images/publish_x.png" width="12" height="12" border="0" alt="Finished" /> |
<img src="images/publish_x.png" width="12" height="12" border="0" alt="Finished" /> |
| 3788 |
</td> |
</td> |
| 3789 |
<td> |
<td> |
| 3790 |
Not Published |
<?php echo T_('Not Published') ?> |
| 3791 |
</td> |
</td> |
| 3792 |
</tr> |
</tr> |
| 3793 |
<tr> |
<tr> |
| 3794 |
<td colspan="8" align="center"> |
<td colspan="8" align="center"> |
| 3795 |
Click on icon to toggle state. |
<?php echo T_('Click on icon to toggle state.') ?> |
| 3796 |
</td> |
</td> |
| 3797 |
</tr> |
</tr> |
| 3798 |
</table> |
</table> |
| 3829 |
</tr> |
</tr> |
| 3830 |
<tr> |
<tr> |
| 3831 |
<td width="90px" valign="top"> |
<td width="90px" valign="top"> |
| 3832 |
Menu |
<?php echo T_('Menu') ?> |
| 3833 |
</td> |
</td> |
| 3834 |
<td> |
<td> |
| 3835 |
<a href="javascript:go2( 'go2menu', '<?php echo $menu->menutype; ?>' );" title="Go to Menu"> |
<a href="javascript:go2( 'go2menu', '<?php echo $menu->menutype; ?>' );" title="<?php echo T_('Go to Menu') ?>"> |
| 3836 |
<?php echo $menu->menutype; ?> |
<?php echo $menu->menutype; ?> |
| 3837 |
</a> |
</a> |
| 3838 |
</td> |
</td> |
| 3839 |
</tr> |
</tr> |
| 3840 |
<tr> |
<tr> |
| 3841 |
<td width="90px" valign="top"> |
<td width="90px" valign="top"> |
| 3842 |
Link Name |
<?php echo T_('Link Name') ?> |
| 3843 |
</td> |
</td> |
| 3844 |
<td> |
<td> |
| 3845 |
<strong> |
<strong> |
| 3851 |
</tr> |
</tr> |
| 3852 |
<tr> |
<tr> |
| 3853 |
<td width="90px" valign="top"> |
<td width="90px" valign="top"> |
| 3854 |
State |
<?php echo T_('State') ?> |
| 3855 |
</td> |
</td> |
| 3856 |
<td> |
<td> |
| 3857 |
<?php |
<?php |
| 3908 |
</tr> |
</tr> |
| 3909 |
<tr> |
<tr> |
| 3910 |
<td width="90px" valign="top"> |
<td width="90px" valign="top"> |
| 3911 |
Menu |
<?php echo T_('Menu') ?> |
| 3912 |
</td> |
</td> |
| 3913 |
<td> |
<td> |
| 3914 |
<a href="javascript:go2( 'go2menu', '<?php echo $menu->menutype; ?>' );" title="Go to Menu"> |
<a href="javascript:go2( 'go2menu', '<?php echo $menu->menutype; ?>' );" title="Go to Menu"> |
| 3918 |
</tr> |
</tr> |
| 3919 |
<tr> |
<tr> |
| 3920 |
<td width="90px" valign="top"> |
<td width="90px" valign="top"> |
| 3921 |
Type |
<?php echo T_('Type') ?> |
| 3922 |
</td> |
</td> |
| 3923 |
<td> |
<td> |
| 3924 |
<?php echo $menu->type; ?> |
<?php echo $menu->type; ?> |
| 3926 |
</tr> |
</tr> |
| 3927 |
<tr> |
<tr> |
| 3928 |
<td width="90px" valign="top"> |
<td width="90px" valign="top"> |
| 3929 |
Item Name |
<?php echo T_('Item Name') ?> |
| 3930 |
</td> |
</td> |
| 3931 |
<td> |
<td> |
| 3932 |
<strong> |
<strong> |
| 3938 |
</tr> |
</tr> |
| 3939 |
<tr> |
<tr> |
| 3940 |
<td width="90px" valign="top"> |
<td width="90px" valign="top"> |
| 3941 |
State |
<?php echo T_('State') ?> |
| 3942 |
</td> |
</td> |
| 3943 |
<td> |
<td> |
| 3944 |
<?php |
<?php |
| 3945 |
switch ( $menu->published ) { |
switch ( $menu->published ) { |
| 3946 |
case -2: |
case -2: |
| 3947 |
echo '<font color="red">Trashed</font>'; |
echo '<font color="red">'.T_('Trashed').'</font>'; |
| 3948 |
break; |
break; |
| 3949 |
case 0: |
case 0: |
| 3950 |
echo 'UnPublished'; |
echo T_('UnPublished'); |
| 3951 |
break; |
break; |
| 3952 |
case 1: |
case 1: |
| 3953 |
default: |
default: |
| 3954 |
echo '<font color="green">Published</font>'; |
echo '<font color="green">'.T_('Published').'</font>'; |
| 3955 |
break; |
break; |
| 3956 |
} |
} |
| 3957 |
?> |
?> |
| 4044 |
function PublishedProcessing( &$row, $i ) { |
function PublishedProcessing( &$row, $i ) { |
| 4045 |
$img = $row->published ? 'publish_g.png' : 'publish_x.png'; |
$img = $row->published ? 'publish_g.png' : 'publish_x.png'; |
| 4046 |
$task = $row->published ? 'unpublish' : 'publish'; |
$task = $row->published ? 'unpublish' : 'publish'; |
| 4047 |
$alt = $row->published ? 'Published' : 'Unpublished'; |
$alt = $row->published ? T_('Published' ): T_('Unpublished'); |
| 4048 |
$action = $row->published ? 'Unpublish Item' : 'Publish item'; |
$action = $row->published ? T_('Unpublish Item') : T_('Publish item'); |
| 4049 |
|
|
| 4050 |
$href = ' |
$href = ' |
| 4051 |
<a href="javascript: void(0);" onclick="return listItemTask(\'cb'. $i .'\',\''. $task .'\')" title="'. $action .'"> |
<a href="javascript: void(0);" onclick="return listItemTask(\'cb'. $i .'\',\''. $task .'\')" title="'. $action .'"> |
| 4097 |
function mosSendAdminMail( $adminName, $adminEmail, $email, $type, $title, $author ) { |
function mosSendAdminMail( $adminName, $adminEmail, $email, $type, $title, $author ) { |
| 4098 |
global $mosConfig_live_site; |
global $mosConfig_live_site; |
| 4099 |
|
|
| 4100 |
$subject = _MAIL_SUB." '$type'"; |
$subject = T_('User Submitted')." '$type'"; |
| 4101 |
$message = _MAIL_MSG; |
$message = T_('_MAIL_MSG'); |
| 4102 |
eval ("\$message = \"$message\";"); |
$message = sprintf(T_('Hello %s,\n\n\nA user submitted %s:\n [ %s ]\n has been just been submitted by user:\n [ %s ]\n for %s.\n\n\n\n |
| 4103 |
|
Please go to %s/administrator to view and approve this %s.\n\n |
| 4104 |
|
Please do not respond to this message as it is automatically generated and is for information purposes only\n'), $adminName, $type, $title, $author, $mosConfig_live_site, $mosConfig_live_site, $type); |
| 4105 |
mosMail($mosConfig_mailfrom, $mosConfig_fromname, $adminEmail, $subject, $message); |
mosMail($mosConfig_mailfrom, $mosConfig_fromname, $adminEmail, $subject, $message); |
| 4106 |
} |
} |
| 4107 |
|
|
| 4121 |
function mosNotAuth() { |
function mosNotAuth() { |
| 4122 |
global $my; |
global $my; |
| 4123 |
|
|
| 4124 |
echo _NOT_AUTH; |
echo T_('You are not authorized to view this resource.'); |
| 4125 |
if ($my->id < 1) { |
if ($my->id < 1) { |
| 4126 |
echo "<br />" . _DO_LOGIN; |
echo "<br />" . T_('You need to login.'); |
| 4127 |
} |
} |
| 4128 |
} |
} |
| 4129 |
|
|