| 18 |
$mosConfig_live_site = mamboCore::get('mosConfig_live_site'); |
$mosConfig_live_site = mamboCore::get('mosConfig_live_site'); |
| 19 |
$from = mamboCore::get('mosConfig_mailfrom'); |
$from = mamboCore::get('mosConfig_mailfrom'); |
| 20 |
$fromname = mamboCore::get('mosConfig_fromname'); |
$fromname = mamboCore::get('mosConfig_fromname'); |
| 21 |
$subject = _MAIL_SUB." '$type'"; |
$subject = sprintf(T_("User Submitted '%s'"), $type); |
| 22 |
$message = _MAIL_MSG; |
$message = T_("Hello %s,\n\n |
| 23 |
eval ("\$message = \"$message\";"); |
A user submitted %s:\n[ %s ]\n |
| 24 |
|
has been just been submitted by user:\n[ %s ]\n\n |
| 25 |
|
for %\n\nPlease go to %s/administrator to view and approve this %s\n\n |
| 26 |
|
Please do not respond to this message as it is automatically generated and is for information purposes only."); |
| 27 |
|
$message = sprintf($message, $adminName ,$type, $title, $author, $mosConfig_live_site, $mosConfig_live_site, $type); |
| 28 |
require_once(mamboCore::get('mosConfig_absolute_path').'/includes/phpmailer/class.phpmailer.php'); |
require_once(mamboCore::get('mosConfig_absolute_path').'/includes/phpmailer/class.phpmailer.php'); |
| 29 |
$mail =& new mosMailer ($from, $fromname, $subject, $message); |
$mail =& new mosMailer ($from, $fromname, $subject, $message); |
| 30 |
return $mail->mosMail($adminEmail); |
return $mail->mosMail($adminEmail); |
| 35 |
* Needed by templates |
* Needed by templates |
| 36 |
*/ |
*/ |
| 37 |
function mosPathWay() { |
function mosPathWay() { |
| 38 |
$pathway = mosPathway::getInstance(); |
$pathway =& mosPathway::getInstance(); |
| 39 |
echo $pathway->makePathway(); |
echo $pathway->makePathway(); |
| 40 |
} |
} |
| 41 |
|
|
| 47 |
function mosNotAuth() { |
function mosNotAuth() { |
| 48 |
global $my; |
global $my; |
| 49 |
|
|
| 50 |
echo _NOT_AUTH; |
echo T_('You are not authorized to view this resource.'); |
| 51 |
if ($my->id < 1) { |
if ($my->id < 1) { |
| 52 |
echo "<br />" . _DO_LOGIN; |
echo "<br />" . T_('You need to login.'); |
| 53 |
} |
} |
| 54 |
} |
} |
| 55 |
|
|
| 72 |
*/ |
*/ |
| 73 |
function mosChmodRecursive($path, $filemode=NULL, $dirmode=NULL) |
function mosChmodRecursive($path, $filemode=NULL, $dirmode=NULL) |
| 74 |
{ |
{ |
| 75 |
$fileman = mosFileManager::getInstance(); |
$fileman =& mosFileManager::getInstance(); |
| 76 |
return $fileman->mosChmodRecursive($path, $filemode, $dirmode); |
return $fileman->mosChmodRecursive($path, $filemode, $dirmode); |
| 77 |
} |
} |
| 78 |
|
|
| 85 |
*/ |
*/ |
| 86 |
function mosChmod($path) |
function mosChmod($path) |
| 87 |
{ |
{ |
| 88 |
$fileman = mosFileManager::getInstance(); |
$fileman =& mosFileManager::getInstance(); |
| 89 |
return $fileman->mosChmod($path); |
return $fileman->mosChmod($path); |
| 90 |
} // mosChmod |
} // mosChmod |
| 91 |
|
|
| 114 |
*/ |
*/ |
| 115 |
function mosStripslashes(&$value) |
function mosStripslashes(&$value) |
| 116 |
{ |
{ |
| 117 |
$database = mamboDatabase::getInstance(); |
$database =& mamboDatabase::getInstance(); |
| 118 |
return $database->mosStripslashes($value); |
return $database->mosStripslashes($value); |
| 119 |
} |
} |
| 120 |
|
|
| 127 |
* @param boolean |
* @param boolean |
| 128 |
*/ |
*/ |
| 129 |
function mosBindArrayToObject( $array, &$obj, $ignore='', $prefix=NULL, $checkSlashes=true ) { |
function mosBindArrayToObject( $array, &$obj, $ignore='', $prefix=NULL, $checkSlashes=true ) { |
| 130 |
$database = mamboDatabase::getInstance(); |
$database =& mamboDatabase::getInstance(); |
| 131 |
return $database->mosBindArrayToOBject($array, $obj, $ignore='', $prefix=NULL, $checkSlashes=true); |
return $database->mosBindArrayToOBject($array, $obj, $ignore='', $prefix=NULL, $checkSlashes=true); |
| 132 |
} |
} |
| 133 |
|
|
| 141 |
function mosReadDirectory( $path, $filter='.', $recurse=false, $fullpath=false ) { |
function mosReadDirectory( $path, $filter='.', $recurse=false, $fullpath=false ) { |
| 142 |
if (@is_dir($path)) { |
if (@is_dir($path)) { |
| 143 |
$dir =& new mosDirectory($path); |
$dir =& new mosDirectory($path); |
| 144 |
$arr = $dir->listFiles ($filter, $type='both', $recurse, $fullpath); |
$arr =& $dir->listFiles ($filter, $type='both', $recurse, $fullpath); |
| 145 |
} |
} |
| 146 |
else $arr = array(); |
else $arr = array(); |
| 147 |
return $arr; |
return $arr; |
| 164 |
* @param boolean Add trailing slash |
* @param boolean Add trailing slash |
| 165 |
*/ |
*/ |
| 166 |
function mosPathName($p_path,$p_addtrailingslash = true) { |
function mosPathName($p_path,$p_addtrailingslash = true) { |
| 167 |
$fileman = mosFileManager::getInstance(); |
$fileman =& mosFileManager::getInstance(); |
| 168 |
return $fileman->mosPathName($p_path,$p_addtrailingslash); |
return $fileman->mosPathName($p_path,$p_addtrailingslash); |
| 169 |
} |
} |
| 170 |
|
|
| 257 |
* @return boolean True if the visitor's group at least equal to the menu access |
* @return boolean True if the visitor's group at least equal to the menu access |
| 258 |
*/ |
*/ |
| 259 |
function mosMenuCheck( $Itemid, $menu_option, $task, $gid ) { |
function mosMenuCheck( $Itemid, $menu_option, $task, $gid ) { |
| 260 |
$menuhandler = mosMenuHandler::getInstance(); |
$menuhandler =& mosMenuHandler::getInstance(); |
| 261 |
return $menuhandler->menuCheck($Itemid, $menu_option, $task, $gid); |
return $menuhandler->menuCheck($Itemid, $menu_option, $task, $gid); |
| 262 |
} |
} |
| 263 |
|
|
| 269 |
* @returns formated date |
* @returns formated date |
| 270 |
*/ |
*/ |
| 271 |
function mosFormatDate( $date, $format="", $offset="" ){ |
function mosFormatDate( $date, $format="", $offset="" ){ |
| 272 |
global $mosConfig_offset; |
$core = mamboCore::getMamboCore(); |
| 273 |
if ( $format == '' ) { |
if ( $format == '' ) { |
| 274 |
// %Y-%m-%d %H:%M:%S |
// %Y-%m-%d %H:%M:%S |
| 275 |
$format = _DATE_FORMAT_LC; |
$format = $core->language['dateformat']; |
| 276 |
} |
} |
| 277 |
if ( $offset == '' ) { |
if ( !$offset ) { |
| 278 |
$offset = $mosConfig_offset; |
$offset = $core->language['offset']; |
| 279 |
} |
} |
| 280 |
if ( $date && ereg( "([0-9]{4})-([0-9]{2})-([0-9]{2})[ ]([0-9]{2}):([0-9]{2}):([0-9]{2})", $date, $regs ) ) { |
if ( $date && ereg( "([0-9]{4})-([0-9]{2})-([0-9]{2})[ ]([0-9]{2}):([0-9]{2}):([0-9]{2})", $date, $regs ) ) { |
| 281 |
$date = mktime( $regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1] ); |
$date = mktime( $regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1] ); |
| 290 |
* @returns current date |
* @returns current date |
| 291 |
*/ |
*/ |
| 292 |
function mosCurrentDate( $format="" ) { |
function mosCurrentDate( $format="" ) { |
| 293 |
global $mosConfig_offset; |
$core =& mamboCore::getMamboCore(); |
| 294 |
|
$offset = $core->language['offset']; |
| 295 |
if ($format=="") { |
if ($format=="") { |
| 296 |
$format = _DATE_FORMAT_LC; |
$format = $format = $core->language['dateformat']; |
| 297 |
} |
} |
| 298 |
$date = strftime( $format, time() + ($mosConfig_offset*60*60) ); |
$date = utf8_encode(strftime( $format, time() + ($offset*60*60) )); |
| 299 |
return $date; |
return $date; |
| 300 |
} |
} |
| 301 |
|
|
| 332 |
* @param string Box title |
* @param string Box title |
| 333 |
* @returns HTML code for Warning |
* @returns HTML code for Warning |
| 334 |
*/ |
*/ |
| 335 |
function mosWarning($warning, $title='Mambo Warning') { |
function mosWarning($warning, $title=null) { |
| 336 |
global $mosConfig_live_site; |
if (is_null($title)) $title = T_('Mambo Warning'); |
| 337 |
|
$mosConfig_live_site = mamboCore::get('mosConfig_live_site'); |
| 338 |
$tip = "<a href=\"#\" onMouseOver=\"return overlib('" . $warning . "', CAPTION, '$title', BELOW, RIGHT);\" onmouseout=\"return nd();\"><img src=\"" . $mosConfig_live_site . "/includes/js/ThemeOffice/warning.png\" border=\"0\" /></a>"; |
$tip = "<a href=\"#\" onMouseOver=\"return overlib('" . $warning . "', CAPTION, '$title', BELOW, RIGHT);\" onmouseout=\"return nd();\"><img src=\"" . $mosConfig_live_site . "/includes/js/ThemeOffice/warning.png\" border=\"0\" /></a>"; |
| 339 |
return $tip; |
return $tip; |
| 340 |
} |
} |
| 382 |
*/ |
*/ |
| 383 |
function mosMakePassword() { |
function mosMakePassword() { |
| 384 |
require_once(mamboCore::get('mosConfig_absolute_path').'/includes/authenticator.php'); |
require_once(mamboCore::get('mosConfig_absolute_path').'/includes/authenticator.php'); |
| 385 |
$authenticator = mamboAuthenticator::getInstance(); |
$authenticator =& mamboAuthenticator::getInstance(); |
| 386 |
return $authenticator->mosMakePassword(); |
return $authenticator->mosMakePassword(); |
| 387 |
} |
} |
| 388 |
|
|