| 10 |
define ('_MOS_ERROR_SEVERE', 2); |
define ('_MOS_ERROR_SEVERE', 2); |
| 11 |
define ('_MOS_ERROR_FATAL', 3); |
define ('_MOS_ERROR_FATAL', 3); |
| 12 |
|
|
| 13 |
|
/** |
| 14 |
|
* Enter description here... |
| 15 |
|
* |
| 16 |
|
*/ |
| 17 |
class mosError { |
class mosError { |
| 18 |
|
/** |
| 19 |
|
* Enter description here... |
| 20 |
|
* |
| 21 |
|
* @var unknown_type |
| 22 |
|
*/ |
| 23 |
var $text = ''; |
var $text = ''; |
| 24 |
|
/** |
| 25 |
|
* Enter description here... |
| 26 |
|
* |
| 27 |
|
* @var unknown_type |
| 28 |
|
*/ |
| 29 |
var $level = 0; |
var $level = 0; |
| 30 |
|
|
| 31 |
|
/** |
| 32 |
|
* Enter description here... |
| 33 |
|
* |
| 34 |
|
* @param unknown_type $text |
| 35 |
|
* @param unknown_type $level |
| 36 |
|
* @return mosError |
| 37 |
|
*/ |
| 38 |
function mosError ($text='', $level=_MOS_ERROR_INFORM) { |
function mosError ($text='', $level=_MOS_ERROR_INFORM) { |
| 39 |
$this->text = $text; |
$this->text = $text; |
| 40 |
$this->level = $level; |
$this->level = $level; |
| 45 |
* Mambo group of errors for some particular operation |
* Mambo group of errors for some particular operation |
| 46 |
*/ |
*/ |
| 47 |
class mosErrorSet { |
class mosErrorSet { |
| 48 |
|
/** |
| 49 |
|
* Enter description here... |
| 50 |
|
* |
| 51 |
|
* @var unknown_type |
| 52 |
|
*/ |
| 53 |
var $errors = array(); |
var $errors = array(); |
| 54 |
|
/** |
| 55 |
|
* Enter description here... |
| 56 |
|
* |
| 57 |
|
* @var unknown_type |
| 58 |
|
*/ |
| 59 |
var $maxlevel = 0; |
var $maxlevel = 0; |
| 60 |
|
|
| 61 |
// Parameter is an error object |
// Parameter is an error object |
| 62 |
|
/** |
| 63 |
|
* Enter description here... |
| 64 |
|
* |
| 65 |
|
* @param unknown_type $error |
| 66 |
|
*/ |
| 67 |
function addError ($error) { |
function addError ($error) { |
| 68 |
$this->errors[] = $error; |
$this->errors[] = $error; |
| 69 |
if ($error->level > $this->maxlevel) $this->maxlevel = $error->level; |
if ($error->level > $this->maxlevel) $this->maxlevel = $error->level; |
| 70 |
} |
} |
| 71 |
|
|
| 72 |
|
/** |
| 73 |
|
* Enter description here... |
| 74 |
|
* |
| 75 |
|
* @param unknown_type $text |
| 76 |
|
* @param unknown_type $level |
| 77 |
|
*/ |
| 78 |
function addErrorDetails ($text='', $level=_MOS_ERROR_INFORM) { |
function addErrorDetails ($text='', $level=_MOS_ERROR_INFORM) { |
| 79 |
$error = new mosError($text, $level); |
$error = new mosError($text, $level); |
| 80 |
$this->addError($error); |
$this->addError($error); |
| 81 |
} |
} |
| 82 |
|
|
| 83 |
|
/** |
| 84 |
|
* Enter description here... |
| 85 |
|
* |
| 86 |
|
* @return unknown |
| 87 |
|
*/ |
| 88 |
function &getErrors () { |
function &getErrors () { |
| 89 |
return $this->errors; |
return $this->errors; |
| 90 |
} |
} |
| 91 |
|
|
| 92 |
|
/** |
| 93 |
|
* Enter description here... |
| 94 |
|
* |
| 95 |
|
* @return unknown |
| 96 |
|
*/ |
| 97 |
function getMaxLevel () { |
function getMaxLevel () { |
| 98 |
return $this->maxlevel; |
return $this->maxlevel; |
| 99 |
} |
} |
| 100 |
|
|
| 101 |
|
/** |
| 102 |
|
* Enter description here... |
| 103 |
|
* |
| 104 |
|
* @return unknown |
| 105 |
|
*/ |
| 106 |
function getCount () { |
function getCount () { |
| 107 |
return count($this->errors); |
return count($this->errors); |
| 108 |
} |
} |
| 109 |
|
|
| 110 |
|
/** |
| 111 |
|
* Enter description here... |
| 112 |
|
* |
| 113 |
|
* @param unknown_type $errorset |
| 114 |
|
*/ |
| 115 |
function mergeAnother ($errorset) { |
function mergeAnother ($errorset) { |
| 116 |
$this->errors = array_merge($this->errors, $errorset->errors); |
$this->errors = array_merge($this->errors, $errorset->errors); |
| 117 |
} |
} |
| 119 |
} |
} |
| 120 |
|
|
| 121 |
|
|
| 122 |
|
/* This is the new error handler to store errors in the database |
| 123 |
|
class mosErrorHandler { |
| 124 |
|
var $types = array ( |
| 125 |
|
E_STRICT => 'Strict check', |
| 126 |
|
E_USER_WARNING => 'User Warning', |
| 127 |
|
E_USER_NOTICE => 'User Notice', |
| 128 |
|
E_WARNING => 'Warning', |
| 129 |
|
E_NOTICE => 'Notice', |
| 130 |
|
E_CORE_WARNING => 'Core Warning', |
| 131 |
|
E_COMPILE_WARNING => 'Compile Warning', |
| 132 |
|
E_USER_ERROR => 'User Error', |
| 133 |
|
E_ERROR => 'Error', |
| 134 |
|
E_PARSE => 'Parse error', |
| 135 |
|
E_CORE_ERROR => 'Core Error', |
| 136 |
|
E_COMPILE_ERROR => 'Compile Error' |
| 137 |
|
); |
| 138 |
|
|
| 139 |
|
function mosErrorHandler () { |
| 140 |
|
set_error_handler(array(&$this, 'handler')); |
| 141 |
|
} |
| 142 |
|
|
| 143 |
|
function handler ($errno, $errstr, $errfile, $errline, $errcontext) { |
| 144 |
|
if ($errno = E_STRICT) return; |
| 145 |
|
$string = $this->types[$errno].': '.$errstr.' in '.$errfile.' at '.$errline; |
| 146 |
|
$database =& mamboDatabase::getInstance(); |
| 147 |
|
if (eregi('^(sql)$', $errstr)) { |
| 148 |
|
$extra = $database->getErrorMsg(); |
| 149 |
|
} |
| 150 |
|
if (function_exists('debug_backtrace')) { |
| 151 |
|
foreach(debug_backtrace() as $back) { |
| 152 |
|
if (@$back['file']) { |
| 153 |
|
$extra .= "\n".$back['file'].':'.$back['line']; |
| 154 |
|
} |
| 155 |
|
} |
| 156 |
|
} |
| 157 |
|
$database->setQuery("DELETE FROM #__errors WHERE file=$errfile AND line=$errline AND number=$errno"); |
| 158 |
|
$database->query(); |
| 159 |
|
$database->setQuery("INSERT INTO #__errors VALUES (0, $errno, '$errfile', $errline, '$string', '$extra')"); |
| 160 |
|
$database->query(); |
| 161 |
|
} |
| 162 |
|
} |
| 163 |
|
*/ |
| 164 |
|
|
| 165 |
|
/** |
| 166 |
|
* Enter description here... |
| 167 |
|
* |
| 168 |
|
*/ |
| 169 |
class mamboCore { |
class mamboCore { |
| 170 |
|
/** |
| 171 |
|
* Enter description here... |
| 172 |
|
* |
| 173 |
|
* @var unknown_type |
| 174 |
|
*/ |
| 175 |
var $rootPath = ''; |
var $rootPath = ''; |
| 176 |
|
/** |
| 177 |
|
* Enter description here... |
| 178 |
|
* |
| 179 |
|
* @var unknown_type |
| 180 |
|
*/ |
| 181 |
var $Itemid = 0; |
var $Itemid = 0; |
| 182 |
|
/** |
| 183 |
|
* Enter description here... |
| 184 |
|
* |
| 185 |
|
* @var unknown_type |
| 186 |
|
*/ |
| 187 |
var $option = ''; |
var $option = ''; |
| 188 |
|
/** |
| 189 |
|
* Enter description here... |
| 190 |
|
* |
| 191 |
|
* @var unknown_type |
| 192 |
|
*/ |
| 193 |
var $subdirectory; |
var $subdirectory; |
| 194 |
|
/** |
| 195 |
|
* Enter description here... |
| 196 |
|
* |
| 197 |
|
* @var unknown_type |
| 198 |
|
*/ |
| 199 |
var $current_user = null; |
var $current_user = null; |
| 200 |
|
/** |
| 201 |
|
* Enter description here... |
| 202 |
|
* |
| 203 |
|
* @var unknown_type |
| 204 |
|
*/ |
| 205 |
var $do_gzip_compress = false; |
var $do_gzip_compress = false; |
| 206 |
|
/** |
| 207 |
|
* Enter description here... |
| 208 |
|
* |
| 209 |
|
* @var unknown_type |
| 210 |
|
*/ |
| 211 |
var $init_errorlevel = 0; |
var $init_errorlevel = 0; |
| 212 |
|
|
| 213 |
|
/** |
| 214 |
|
* Enter description here... |
| 215 |
|
* |
| 216 |
|
* @return mamboCore |
| 217 |
|
*/ |
| 218 |
function mamboCore () { |
function mamboCore () { |
| 219 |
global $adminside; |
global $adminside; |
| 220 |
$this->init_errorlevel = error_reporting(0); |
$this->init_errorlevel = error_reporting(0); |
| 221 |
$this->rootPath = str_replace('\\', '/', realpath('../')); |
$this->rootPath = str_replace('\\', '/', realpath(str_replace('includes', '', dirname(__FILE__)))); |
| 222 |
$this->checkConfig(); |
$this->checkConfig(); |
| 223 |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
| 224 |
$this->getConfig(); |
$this->getConfig(); |
| 228 |
else error_reporting($this->init_errorlevel); |
else error_reporting($this->init_errorlevel); |
| 229 |
} |
} |
| 230 |
|
|
| 231 |
|
/** |
| 232 |
|
* Enter description here... |
| 233 |
|
* |
| 234 |
|
* @return unknown |
| 235 |
|
*/ |
| 236 |
function &getMamboCore () { |
function &getMamboCore () { |
| 237 |
static $instance; |
static $instance; |
| 238 |
if (!is_object($instance)) $instance = new mamboCore(); |
if (!is_object($instance)) $instance = new mamboCore(); |
| 239 |
return $instance; |
return $instance; |
| 240 |
} |
} |
| 241 |
|
|
| 242 |
|
/** |
| 243 |
|
* Enter description here... |
| 244 |
|
* |
| 245 |
|
* @return unknown |
| 246 |
|
*/ |
| 247 |
function rootPath () { |
function rootPath () { |
| 248 |
if (realpath($this->rootPath) === false) die ('Invalid program load path'); |
if (realpath($this->rootPath) === false) die ('Invalid program load path'); |
| 249 |
return $this->rootPath; |
return $this->rootPath; |
| 250 |
} |
} |
| 251 |
|
|
| 252 |
|
/** |
| 253 |
|
* Enter description here... |
| 254 |
|
* |
| 255 |
|
* @param unknown_type $property |
| 256 |
|
* @return unknown |
| 257 |
|
*/ |
| 258 |
function get ($property) { |
function get ($property) { |
| 259 |
$config =& mamboCore::getMamboCore(); |
$config =& mamboCore::getMamboCore(); |
| 260 |
if ($property == 'mosConfig_absolute_path') { |
if ($property == 'mosConfig_absolute_path') { |
| 266 |
return null; |
return null; |
| 267 |
} |
} |
| 268 |
|
|
| 269 |
|
/** |
| 270 |
|
* Enter description here... |
| 271 |
|
* |
| 272 |
|
* @param unknown_type $property |
| 273 |
|
* @return unknown |
| 274 |
|
*/ |
| 275 |
function is_set ($property) { |
function is_set ($property) { |
| 276 |
$config =& mamboCore::getMamboCore(); |
$config =& mamboCore::getMamboCore(); |
| 277 |
return isset($config->$property); |
return isset($config->$property); |
| 278 |
} |
} |
| 279 |
|
|
| 280 |
|
/** |
| 281 |
|
* Enter description here... |
| 282 |
|
* |
| 283 |
|
* @param unknown_type $property |
| 284 |
|
* @param unknown_type $value |
| 285 |
|
* @return unknown |
| 286 |
|
*/ |
| 287 |
function set ($property, $value) { |
function set ($property, $value) { |
| 288 |
$config =& mamboCore::getMamboCore(); |
$config =& mamboCore::getMamboCore(); |
| 289 |
$config->$property = $value; |
$config->$property = $value; |
| 291 |
return $value; |
return $value; |
| 292 |
} |
} |
| 293 |
|
|
| 294 |
|
/** |
| 295 |
|
* Enter description here... |
| 296 |
|
* |
| 297 |
|
*/ |
| 298 |
function checkConfig () { |
function checkConfig () { |
| 299 |
// checks for configuration file, if none found loads installation page |
// checks for configuration file, if none found loads installation page |
| 300 |
if (!file_exists($this->rootPath.'/configuration.php') OR filesize($this->rootPath.'/configuration.php') < 10 ) { |
if (!file_exists($this->rootPath.'/configuration.php') OR filesize($this->rootPath.'/configuration.php') < 10 ) { |
| 303 |
} |
} |
| 304 |
} |
} |
| 305 |
|
|
| 306 |
|
/** |
| 307 |
|
* Enter description here... |
| 308 |
|
* |
| 309 |
|
*/ |
| 310 |
function getConfig () { |
function getConfig () { |
| 311 |
global $adminside; |
global $adminside; |
| 312 |
$code = ''; |
$code = ''; |
| 319 |
} |
} |
| 320 |
} |
} |
| 321 |
else { |
else { |
| 322 |
header( 'Location: installation/index.php' ); |
#header( 'Location: installation/index.php' ); |
| 323 |
exit(); |
exit(); |
| 324 |
} |
} |
| 325 |
fclose($f); |
fclose($f); |
| 326 |
eval($code); |
eval($code); |
| 327 |
if (isset($_SERVER['DOCUMENT_ROOT']) AND strlen($_SERVER['DOCUMENT_ROOT'])) $docroot = str_replace('\\', '/', str_replace('\\\\', '\\', $_SERVER['DOCUMENT_ROOT'])); |
|
| 328 |
|
|
| 329 |
|
if (isset($_SERVER['DOCUMENT_ROOT']) AND strlen($_SERVER['DOCUMENT_ROOT'])) { |
| 330 |
|
$docroot = str_replace('\\', '/', str_replace('\\\\', '\\', $_SERVER['DOCUMENT_ROOT'])); |
| 331 |
|
} |
| 332 |
else { |
else { |
| 333 |
// Find information about where execution started |
// Find information about where execution started |
| 334 |
$origin = array_pop(debug_backtrace()); |
$origin = array_pop(debug_backtrace()); |
| 337 |
$localpath = $_SERVER['PHP_SELF']; |
$localpath = $_SERVER['PHP_SELF']; |
| 338 |
$docroot = substr($absolutepath,0,strpos($absolutepath,$localpath)); |
$docroot = substr($absolutepath,0,strpos($absolutepath,$localpath)); |
| 339 |
} |
} |
| 340 |
$mamboroot = str_replace('\\', '/', dirname(__FILE__)); |
$mamboroot = str_replace('\\', '/', rtrim($this->rootPath, '\/')); |
| 341 |
$this->subdirectory = substr($mamboroot, strlen($docroot)); |
$this->subdirectory = substr($mamboroot, strlen($docroot)); |
| 342 |
|
|
| 343 |
|
|
| 344 |
$scheme = isset($_SERVER['HTTP_SCHEME']) ? $_SERVER['HTTP_SCHEME'] : ((isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS'] != 'off')) ? 'https' : 'http'); |
$scheme = isset($_SERVER['HTTP_SCHEME']) ? $_SERVER['HTTP_SCHEME'] : ((isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS'] != 'off')) ? 'https' : 'http'); |
| 345 |
if (isset($_SERVER['HTTP_HOST'])) { |
if (isset($_SERVER['HTTP_HOST'])) { |
| 346 |
$withport = explode(':', $_SERVER['HTTP_HOST']); |
$withport = explode(':', $_SERVER['HTTP_HOST']); |
| 364 |
$this->mosConfig_register_globals = 0; |
$this->mosConfig_register_globals = 0; |
| 365 |
$GLOBALS['mosConfig_register_globals'] = 0; |
$GLOBALS['mosConfig_register_globals'] = 0; |
| 366 |
} |
} |
| 367 |
|
|
| 368 |
} |
} |
| 369 |
|
|
| 370 |
|
/** |
| 371 |
|
* Enter description here... |
| 372 |
|
* |
| 373 |
|
* @return unknown |
| 374 |
|
*/ |
| 375 |
function getFavIcon () { |
function getFavIcon () { |
| 376 |
// favourites icon |
// favourites icon |
| 377 |
if (!isset($this->mosConfig_favicon)) $this->mosConfig_favicon = 'favicon.ico'; |
if (!isset($this->mosConfig_favicon)) $this->mosConfig_favicon = 'favicon.ico'; |
| 379 |
return $this->mosConfig_live_site.'/images/'.$this->mosConfig_favicon; |
return $this->mosConfig_live_site.'/images/'.$this->mosConfig_favicon; |
| 380 |
} |
} |
| 381 |
|
|
| 382 |
|
/** |
| 383 |
|
* Enter description here... |
| 384 |
|
* |
| 385 |
|
* @param unknown_type $user |
| 386 |
|
* @param unknown_type $database |
| 387 |
|
*/ |
| 388 |
function offlineCheck (&$user, &$database) { |
function offlineCheck (&$user, &$database) { |
| 389 |
if ($this->mosConfig_offline OR file_exists($this->rootPath.'/installation/index.php')) { |
if ($this->mosConfig_offline OR file_exists($this->rootPath.'/installation/index.php')) { |
| 390 |
require_once($this->rootPath().'/administrator/includes/admin.php'); |
require_once($this->rootPath().'/administrator/includes/admin.php'); |
| 399 |
} |
} |
| 400 |
} |
} |
| 401 |
|
|
| 402 |
|
/** |
| 403 |
|
* Enter description here... |
| 404 |
|
* |
| 405 |
|
*/ |
| 406 |
function fixLanguage () { |
function fixLanguage () { |
| 407 |
require_once($this->mosConfig_absolute_path.'/includes/phpgettext/phpgettext.class.php'); |
require_once($this->mosConfig_absolute_path.'/includes/phpgettext/phpgettext.class.php'); |
| 408 |
require_once($this->mosConfig_absolute_path.'/includes/phpgettext/error.php'); |
require_once($this->mosConfig_absolute_path.'/includes/phpgettext/error.php'); |
| 409 |
require_once($this->mosConfig_absolute_path.'/includes/mambofunc.php'); |
require_once($this->mosConfig_absolute_path.'/includes/mambofunc.php'); |
| 410 |
require_once($this->mosConfig_absolute_path.'/includes/mambolanguage.class.php'); |
require_once($this->mosConfig_absolute_path.'/includes/mambolanguage.class.php'); |
| 411 |
error_reporting(E_ALL) ; |
#error_reporting(E_ALL) ; |
| 412 |
########## DEPRECATED ############ |
########## DEPRECATED ############ |
| 413 |
if (isset($this->mosConfig_lang) AND $this->mosConfig_lang); |
if (isset($this->mosConfig_lang) AND $this->mosConfig_lang); |
| 414 |
else $this->set('mosConfig_lang', 'english'); |
else $this->set('mosConfig_lang', 'english'); |
| 417 |
################################### |
################################### |
| 418 |
|
|
| 419 |
|
|
| 420 |
$this->mosConfig_lang = mosGetParam($_POST, 'setLanguage', $this->mosConfig_lang); |
$this->mosConfig_lang = mosGetParam($_POST, 'user_lang', $this->mosConfig_lang); |
| 421 |
|
|
| 422 |
|
|
| 423 |
$language =& mamboLanguage::getInstance($this->mosConfig_lang, $this->rootPath.'/language/'); |
$language =& new mamboLanguage($this->mosConfig_lang, $this->rootPath.'/language/'); |
| 424 |
$languages = $language->getLanguages(); |
$languages = $language->getLanguages(); |
| 425 |
$charset = $language->get('charset'); |
$charset = $language->get('charset'); |
| 426 |
$dateformat = $language->get('dateformat'); |
$dateformat = $language->get('dateformat'); |
| 429 |
if (!defined('_DATE_FORMAT_LC')) DEFINE('_DATE_FORMAT_LC', $dateformat); //Uses PHP's strftime Command Format |
if (!defined('_DATE_FORMAT_LC')) DEFINE('_DATE_FORMAT_LC', $dateformat); //Uses PHP's strftime Command Format |
| 430 |
if (!defined('_DATE_FORMAT_LC2')) DEFINE('_DATE_FORMAT_LC2', $dateformat); |
if (!defined('_DATE_FORMAT_LC2')) DEFINE('_DATE_FORMAT_LC2', $dateformat); |
| 431 |
|
|
| 432 |
$gettext =& phpgettext(); |
|
|
$gettext->debug = $this->mosConfig_locale_debug; |
|
|
$gettext->has_gettext = $this->mosConfig_locale_use_gettext; |
|
|
$gettext->setlocale($this->mosConfig_lang); |
|
| 433 |
} |
} |
| 434 |
|
|
| 435 |
|
/** |
| 436 |
|
* Enter description here... |
| 437 |
|
* |
| 438 |
|
*/ |
| 439 |
function handleGlobals () { |
function handleGlobals () { |
| 440 |
$superglobals = array($_SERVER, $_ENV, $_FILES, $_COOKIE, $_POST, $_GET); |
$superglobals = array($_SERVER, $_ENV, $_FILES, $_COOKIE, $_POST, $_GET); |
| 441 |
if (isset( $_SESSION )) array_unshift ( $superglobals , $_SESSION ); |
if (isset( $_SESSION )) array_unshift ( $superglobals , $_SESSION ); |
| 459 |
} |
} |
| 460 |
} |
} |
| 461 |
|
|
| 462 |
|
/** |
| 463 |
|
* Enter description here... |
| 464 |
|
* |
| 465 |
|
* @return unknown |
| 466 |
|
*/ |
| 467 |
function determineOptionAndItemid () { |
function determineOptionAndItemid () { |
| 468 |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
| 469 |
if ($option = strtolower(mosGetParam($_REQUEST, 'option'))); |
if ($option = strtolower(mosGetParam($_REQUEST, 'option'))); |
| 503 |
return $option; |
return $option; |
| 504 |
} |
} |
| 505 |
|
|
| 506 |
|
/** |
| 507 |
|
* Enter description here... |
| 508 |
|
* |
| 509 |
|
* @param unknown_type $url |
| 510 |
|
* @param unknown_type $msg |
| 511 |
|
*/ |
| 512 |
function redirect ($url, $msg='') { |
function redirect ($url, $msg='') { |
| 513 |
$callcheck = array('InputFilter', 'process'); |
$callcheck = array('InputFilter', 'process'); |
| 514 |
if (!is_callable($callcheck)) require_once(mamboCore::get('mosConfig_absolute_path').'/includes/phpInputFilter/class.inputfilter.php'); |
if (!is_callable($callcheck)) require_once(mamboCore::get('mosConfig_absolute_path').'/includes/phpInputFilter/class.inputfilter.php'); |
| 529 |
exit(); |
exit(); |
| 530 |
} |
} |
| 531 |
|
|
| 532 |
|
/** |
| 533 |
|
* Enter description here... |
| 534 |
|
* |
| 535 |
|
* @param unknown_type $text |
| 536 |
|
*/ |
| 537 |
function logMessage ($text) { |
function logMessage ($text) { |
| 538 |
// JS Popup message |
// JS Popup message |
| 539 |
if (mosGetParam( $_POST, 'message', 0 )) { |
if (mosGetParam( $_POST, 'message', 0 )) { |
| 553 |
} |
} |
| 554 |
} |
} |
| 555 |
|
|
| 556 |
|
/** |
| 557 |
|
* Enter description here... |
| 558 |
|
* |
| 559 |
|
*/ |
| 560 |
function handleLogin () { |
function handleLogin () { |
| 561 |
require_once($this->rootPath().'/includes/authenticator.php'); |
require_once($this->rootPath().'/includes/authenticator.php'); |
| 562 |
$authenticator =& mamboAuthenticator::getInstance(); |
$authenticator =& mamboAuthenticator::getInstance(); |
| 565 |
else mamboCore::redirect('index.php'); |
else mamboCore::redirect('index.php'); |
| 566 |
} |
} |
| 567 |
|
|
| 568 |
|
/** |
| 569 |
|
* Enter description here... |
| 570 |
|
* |
| 571 |
|
*/ |
| 572 |
function handleLogout () { |
function handleLogout () { |
| 573 |
require_once($this->rootPath().'/includes/authenticator.php'); |
require_once($this->rootPath().'/includes/authenticator.php'); |
| 574 |
$authenticator =& mamboAuthenticator::getInstance(); |
$authenticator =& mamboAuthenticator::getInstance(); |
| 576 |
$this->logMessage(_LOGOUT_SUCCESS); |
$this->logMessage(_LOGOUT_SUCCESS); |
| 577 |
} |
} |
| 578 |
|
|
| 579 |
|
/** |
| 580 |
|
* Enter description here... |
| 581 |
|
* |
| 582 |
|
*/ |
| 583 |
function standardHeaders () { |
function standardHeaders () { |
| 584 |
header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' ); |
header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' ); |
| 585 |
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); |
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); |
| 591 |
$mambothandler->trigger('onHeaders', array($this)); |
$mambothandler->trigger('onHeaders', array($this)); |
| 592 |
} |
} |
| 593 |
|
|
| 594 |
|
/** |
| 595 |
|
* Enter description here... |
| 596 |
|
* |
| 597 |
|
*/ |
| 598 |
function initGzip() { |
function initGzip() { |
| 599 |
$this->do_gzip_compress = FALSE; |
$this->do_gzip_compress = FALSE; |
| 600 |
//zlib.output_compression and ob_gzhandler don't get along well so we'll check to make |
//zlib.output_compression and ob_gzhandler don't get along well so we'll check to make |
| 655 |
} |
} |
| 656 |
} |
} |
| 657 |
|
|
| 658 |
|
/** |
| 659 |
|
* Enter description here... |
| 660 |
|
* |
| 661 |
|
* @param unknown_type $separator |
| 662 |
|
* @param unknown_type $field |
| 663 |
|
* @return unknown |
| 664 |
|
*/ |
| 665 |
function getLastPart ($separator, $field) { |
function getLastPart ($separator, $field) { |
| 666 |
$parts = explode($separator, $field); |
$parts = explode($separator, $field); |
| 667 |
return $parts[count($parts)-1]; |
return $parts[count($parts)-1]; |
| 668 |
} |
} |
| 669 |
|
|
| 670 |
|
/** |
| 671 |
|
* Enter description here... |
| 672 |
|
* |
| 673 |
|
* @param unknown_type $separator |
| 674 |
|
* @param unknown_type $field |
| 675 |
|
* @return unknown |
| 676 |
|
*/ |
| 677 |
function allButLast ($separator, $field) { |
function allButLast ($separator, $field) { |
| 678 |
$lastSize = strlen(mamboCore::getLastPart($separator,$field)); |
$lastSize = strlen(mamboCore::getLastPart($separator,$field)); |
| 679 |
return substr($field, 0, strlen($field)-$lastSize); |
return substr($field, 0, strlen($field)-$lastSize); |
| 686 |
* Sorts an Array of objects |
* Sorts an Array of objects |
| 687 |
*/ |
*/ |
| 688 |
class mosObjectSorter { |
class mosObjectSorter { |
| 689 |
|
/** |
| 690 |
|
* Enter description here... |
| 691 |
|
* |
| 692 |
|
* @var unknown_type |
| 693 |
|
*/ |
| 694 |
var $_keyname = ''; |
var $_keyname = ''; |
| 695 |
|
/** |
| 696 |
|
* Enter description here... |
| 697 |
|
* |
| 698 |
|
* @var unknown_type |
| 699 |
|
*/ |
| 700 |
var $_direction = 0; |
var $_direction = 0; |
| 701 |
|
/** |
| 702 |
|
* Enter description here... |
| 703 |
|
* |
| 704 |
|
* @var unknown_type |
| 705 |
|
*/ |
| 706 |
var $_object_array = array(); |
var $_object_array = array(); |
| 707 |
|
|
| 708 |
|
/** |
| 709 |
|
* Enter description here... |
| 710 |
|
* |
| 711 |
|
* @param unknown_type $a |
| 712 |
|
* @param unknown_type $k |
| 713 |
|
* @param unknown_type $sort_direction |
| 714 |
|
* @return mosObjectSorter |
| 715 |
|
*/ |
| 716 |
function mosObjectSorter (&$a, $k, $sort_direction=1) { |
function mosObjectSorter (&$a, $k, $sort_direction=1) { |
| 717 |
$this->_keyname = $k; |
$this->_keyname = $k; |
| 718 |
$this->_direction = $sort_direction; |
$this->_direction = $sort_direction; |
| 720 |
$this->sort(); |
$this->sort(); |
| 721 |
} |
} |
| 722 |
|
|
| 723 |
|
/** |
| 724 |
|
* Enter description here... |
| 725 |
|
* |
| 726 |
|
* @param unknown_type $a |
| 727 |
|
* @param unknown_type $b |
| 728 |
|
* @return unknown |
| 729 |
|
*/ |
| 730 |
function mosObjectCompare (&$a, &$b) { |
function mosObjectCompare (&$a, &$b) { |
| 731 |
$key = $this->_keyname; |
$key = $this->_keyname; |
| 732 |
if ($a->$key > $b->$key) return $this->_direction; |
if ($a->$key > $b->$key) return $this->_direction; |
| 734 |
return 0; |
return 0; |
| 735 |
} |
} |
| 736 |
|
|
| 737 |
|
/** |
| 738 |
|
* Enter description here... |
| 739 |
|
* |
| 740 |
|
*/ |
| 741 |
function sort () { |
function sort () { |
| 742 |
usort($this->_object_array, array($this,'mosObjectCompare')); |
usort($this->_object_array, array($this,'mosObjectCompare')); |
| 743 |
} |
} |
| 786 |
$this->_urls[$last+1] = $url; |
$this->_urls[$last+1] = $url; |
| 787 |
} |
} |
| 788 |
|
|
| 789 |
|
/** |
| 790 |
|
* Enter description here... |
| 791 |
|
* |
| 792 |
|
*/ |
| 793 |
function reduceToOne () { |
function reduceToOne () { |
| 794 |
for ($i = count($this->_names) - 1; $i > 0; $i--) { |
for ($i = count($this->_names) - 1; $i > 0; $i--) { |
| 795 |
unset($this->_names[$i]); |
unset($this->_names[$i]); |
| 913 |
return $instance; |
return $instance; |
| 914 |
} |
} |
| 915 |
|
|
| 916 |
|
/** |
| 917 |
|
* Enter description here... |
| 918 |
|
* |
| 919 |
|
* @param unknown_type $file |
| 920 |
|
* @return unknown |
| 921 |
|
*/ |
| 922 |
function deleteFile ($file) { |
function deleteFile ($file) { |
| 923 |
if (file_exists($file)) { |
if (file_exists($file)) { |
| 924 |
@chmod($file, 0644); |
@chmod($file, 0644); |
| 927 |
return true; |
return true; |
| 928 |
} |
} |
| 929 |
|
|
| 930 |
|
/** |
| 931 |
|
* Enter description here... |
| 932 |
|
* |
| 933 |
|
* @param unknown_type $dir |
| 934 |
|
* @return unknown |
| 935 |
|
*/ |
| 936 |
function deleteDirectory ($dir) { |
function deleteDirectory ($dir) { |
| 937 |
if (file_exists($dir)) { |
if (file_exists($dir)) { |
| 938 |
if (is_dir($dir)) { |
if (is_dir($dir)) { |
| 944 |
return true; |
return true; |
| 945 |
} |
} |
| 946 |
|
|
| 947 |
|
/** |
| 948 |
|
* Enter description here... |
| 949 |
|
* |
| 950 |
|
* @param unknown_type $fileSysObject |
| 951 |
|
*/ |
| 952 |
function setPermissions ($fileSysObject) { |
function setPermissions ($fileSysObject) { |
| 953 |
if (file_exists($fileSysObject)) { |
if (file_exists($fileSysObject)) { |
| 954 |
if (is_dir($fileSysObject)) $perms = mamboCore::get('mosConfig_dirperms'); |
if (is_dir($fileSysObject)) $perms = mamboCore::get('mosConfig_dirperms'); |
| 962 |
} |
} |
| 963 |
} |
} |
| 964 |
|
|
| 965 |
|
/** |
| 966 |
|
* Enter description here... |
| 967 |
|
* |
| 968 |
|
* @param unknown_type $dir |
| 969 |
|
* @return unknown |
| 970 |
|
*/ |
| 971 |
function makeDirectory ($dir) { |
function makeDirectory ($dir) { |
| 972 |
$perms = mamboCore::get('mosConfig_dirperms'); |
$perms = mamboCore::get('mosConfig_dirperms'); |
| 973 |
$origmask = @umask(0); |
$origmask = @umask(0); |
| 979 |
} |
} |
| 980 |
|
|
| 981 |
|
|
| 982 |
|
/** |
| 983 |
|
* Enter description here... |
| 984 |
|
* |
| 985 |
|
* @param unknown_type $dir |
| 986 |
|
* @param unknown_type $onlyCheck |
| 987 |
|
* @return unknown |
| 988 |
|
*/ |
| 989 |
function createDirectory ($dir, $onlyCheck=false) { |
function createDirectory ($dir, $onlyCheck=false) { |
| 990 |
if (file_exists($dir)) { |
if (file_exists($dir)) { |
| 991 |
if (is_dir($dir) AND is_writable($dir)) return true; |
if (is_dir($dir) AND is_writable($dir)) return true; |
| 999 |
else return $this->makeDirectory($dir); |
else return $this->makeDirectory($dir); |
| 1000 |
} |
} |
| 1001 |
|
|
| 1002 |
|
/** |
| 1003 |
|
* Enter description here... |
| 1004 |
|
* |
| 1005 |
|
* @param unknown_type $dir |
| 1006 |
|
* @return unknown |
| 1007 |
|
*/ |
| 1008 |
function containingDirectory ($dir) { |
function containingDirectory ($dir) { |
| 1009 |
$dirs = preg_split('*[/|\\\]*', $dir); |
$dirs = preg_split('*[/|\\\]*', $dir); |
| 1010 |
for ($i = count($dirs)-1; $i >= 0; $i--) { |
for ($i = count($dirs)-1; $i >= 0; $i--) { |
| 1017 |
return array($result1, $result2); |
return array($result1, $result2); |
| 1018 |
} |
} |
| 1019 |
|
|
| 1020 |
|
/** |
| 1021 |
|
* Enter description here... |
| 1022 |
|
* |
| 1023 |
|
* @param unknown_type $from |
| 1024 |
|
* @param unknown_type $to |
| 1025 |
|
* @return unknown |
| 1026 |
|
*/ |
| 1027 |
function simpleCopy ($from, $to) { |
function simpleCopy ($from, $to) { |
| 1028 |
if (@copy($from, $to)) { |
if (@copy($from, $to)) { |
| 1029 |
$this->setPermissions($to); |
$this->setPermissions($to); |
| 1032 |
else return false; |
else return false; |
| 1033 |
} |
} |
| 1034 |
|
|
| 1035 |
|
/** |
| 1036 |
|
* Enter description here... |
| 1037 |
|
* |
| 1038 |
|
* @param unknown_type $from |
| 1039 |
|
* @param unknown_type $to |
| 1040 |
|
* @return unknown |
| 1041 |
|
*/ |
| 1042 |
function forceCopy ($from, $to) { |
function forceCopy ($from, $to) { |
| 1043 |
$todir = dirname($to); |
$todir = dirname($to); |
| 1044 |
if (!file_exists($todir)) $this->createDirectory($todir); |
if (!file_exists($todir)) $this->createDirectory($todir); |
| 1048 |
return $this->simpleCopy ($from, $to); |
return $this->simpleCopy ($from, $to); |
| 1049 |
} |
} |
| 1050 |
|
|
| 1051 |
|
/** |
| 1052 |
|
* Enter description here... |
| 1053 |
|
* |
| 1054 |
|
* @param unknown_type $from |
| 1055 |
|
* @param unknown_type $to |
| 1056 |
|
* @return unknown |
| 1057 |
|
*/ |
| 1058 |
function lightCopy ($from, $to) { |
function lightCopy ($from, $to) { |
| 1059 |
$name = basename($from); |
$name = basename($from); |
| 1060 |
if (file_exists($to.$name)) return false; |
if (file_exists($to.$name)) return false; |
| 1064 |
return $this->simpleCopy ($from, $to); |
return $this->simpleCopy ($from, $to); |
| 1065 |
} |
} |
| 1066 |
|
|
| 1067 |
|
/** |
| 1068 |
|
* Enter description here... |
| 1069 |
|
* |
| 1070 |
|
* @param unknown_type $to |
| 1071 |
|
* @return unknown |
| 1072 |
|
*/ |
| 1073 |
function acceptCopy ($to) { |
function acceptCopy ($to) { |
| 1074 |
$todir = dirname($to); |
$todir = dirname($to); |
| 1075 |
return $this->createDirectory($todir, true); |
return $this->createDirectory($todir, true); |
| 1142 |
|
|
| 1143 |
} |
} |
| 1144 |
|
|
| 1145 |
|
/** |
| 1146 |
|
* Enter description here... |
| 1147 |
|
* |
| 1148 |
|
*/ |
| 1149 |
class mosDirectory { |
class mosDirectory { |
| 1150 |
|
/** |
| 1151 |
|
* Enter description here... |
| 1152 |
|
* |
| 1153 |
|
* @var unknown_type |
| 1154 |
|
*/ |
| 1155 |
var $path = ''; |
var $path = ''; |
| 1156 |
|
|
| 1157 |
|
/** |
| 1158 |
|
* Enter description here... |
| 1159 |
|
* |
| 1160 |
|
* @param unknown_type $path |
| 1161 |
|
* @return mosDirectory |
| 1162 |
|
*/ |
| 1163 |
function mosDirectory ($path) { |
function mosDirectory ($path) { |
| 1164 |
$path = str_replace('\\', '/', $path); |
$path = str_replace('\\', '/', $path); |
| 1165 |
if (substr($path,-1,1) == '/') $this->path = $path; |
if (substr($path,-1,1) == '/') $this->path = $path; |
| 1166 |
else $this->path = $path.'/'; |
else $this->path = $path.'/'; |
| 1167 |
} |
} |
| 1168 |
|
|
| 1169 |
|
/** |
| 1170 |
|
* Enter description here... |
| 1171 |
|
* |
| 1172 |
|
* @param unknown_type $type |
| 1173 |
|
* @param unknown_type $recurse |
| 1174 |
|
* @param unknown_type $fullpath |
| 1175 |
|
* @return unknown |
| 1176 |
|
*/ |
| 1177 |
function &listAll ($type='file', $recurse=false, $fullpath=false) { |
function &listAll ($type='file', $recurse=false, $fullpath=false) { |
| 1178 |
$results = array(); |
$results = array(); |
| 1179 |
if ($dir = @opendir($this->path)) { |
if ($dir = @opendir($this->path)) { |
| 1196 |
return $results; |
return $results; |
| 1197 |
} |
} |
| 1198 |
|
|
| 1199 |
|
/** |
| 1200 |
|
* Enter description here... |
| 1201 |
|
* |
| 1202 |
|
* @return unknown |
| 1203 |
|
*/ |
| 1204 |
function soleDir () { |
function soleDir () { |
| 1205 |
$found = ''; |
$found = ''; |
| 1206 |
if ($dir = @opendir($this->path)) { |
if ($dir = @opendir($this->path)) { |
| 1217 |
return $found; |
return $found; |
| 1218 |
} |
} |
| 1219 |
|
|
| 1220 |
|
/** |
| 1221 |
|
* Enter description here... |
| 1222 |
|
* |
| 1223 |
|
*/ |
| 1224 |
function deleteAll () { |
function deleteAll () { |
| 1225 |
if (!file_exists($this->path)) return; |
if (!file_exists($this->path)) return; |
| 1226 |
$subdirs =& $this->listAll ('dir', false, true); |
$subdirs =& $this->listAll ('dir', false, true); |
| 1235 |
$filemanager->deleteDirectory($this->path); |
$filemanager->deleteDirectory($this->path); |
| 1236 |
} |
} |
| 1237 |
|
|
| 1238 |
|
/** |
| 1239 |
|
* Enter description here... |
| 1240 |
|
* |
| 1241 |
|
* @return unknown |
| 1242 |
|
*/ |
| 1243 |
function createFresh () { |
function createFresh () { |
| 1244 |
$this->deleteAll(); |
$this->deleteAll(); |
| 1245 |
$filemanager =& mosFileManager::getInstance(); |
$filemanager =& mosFileManager::getInstance(); |
| 1247 |
return true; |
return true; |
| 1248 |
} |
} |
| 1249 |
|
|
| 1250 |
|
/** |
| 1251 |
|
* Enter description here... |
| 1252 |
|
* |
| 1253 |
|
*/ |
| 1254 |
function createIfNeeded () { |
function createIfNeeded () { |
| 1255 |
if (!file_exists($this->path)) { |
if (!file_exists($this->path)) { |
| 1256 |
$filemanager =& mosFileManager::getInstance(); |
$filemanager =& mosFileManager::getInstance(); |
| 1258 |
} |
} |
| 1259 |
} |
} |
| 1260 |
|
|
| 1261 |
|
/** |
| 1262 |
|
* Enter description here... |
| 1263 |
|
* |
| 1264 |
|
* @param unknown_type $pattern |
| 1265 |
|
* @param unknown_type $type |
| 1266 |
|
* @param unknown_type $recurse |
| 1267 |
|
* @param unknown_type $fullpath |
| 1268 |
|
* @return unknown |
| 1269 |
|
*/ |
| 1270 |
function &listFiles ($pattern='', $type='file', $recurse=false, $fullpath=false) { |
function &listFiles ($pattern='', $type='file', $recurse=false, $fullpath=false) { |
| 1271 |
$results = array(); |
$results = array(); |
| 1272 |
$all =& $this->listAll($type, $recurse, $fullpath); |
$all =& $this->listAll($type, $recurse, $fullpath); |
| 1278 |
return $results; |
return $results; |
| 1279 |
} |
} |
| 1280 |
|
|
| 1281 |
|
/** |
| 1282 |
|
* Enter description here... |
| 1283 |
|
* |
| 1284 |
|
* @return unknown |
| 1285 |
|
*/ |
| 1286 |
function getSize () { |
function getSize () { |
| 1287 |
$totalsize = 0; |
$totalsize = 0; |
| 1288 |
$files =& $this->listFiles(); |
$files =& $this->listFiles(); |
| 1335 |
return $instance; |
return $instance; |
| 1336 |
} |
} |
| 1337 |
|
|
| 1338 |
|
/** |
| 1339 |
|
* Enter description here... |
| 1340 |
|
* |
| 1341 |
|
* @param unknown_type $id |
| 1342 |
|
* @return unknown |
| 1343 |
|
*/ |
| 1344 |
function &getMenuByID ($id) { |
function &getMenuByID ($id) { |
| 1345 |
if (isset($this->_idlinks[$id])) { |
if (isset($this->_idlinks[$id])) { |
| 1346 |
$key = $this->_idlinks[$id]; |
$key = $this->_idlinks[$id]; |
| 1350 |
return $result; |
return $result; |
| 1351 |
} |
} |
| 1352 |
|
|
| 1353 |
|
/** |
| 1354 |
|
* Enter description here... |
| 1355 |
|
* |
| 1356 |
|
* @param unknown_type $type |
| 1357 |
|
* @param unknown_type $published |
| 1358 |
|
* @return unknown |
| 1359 |
|
*/ |
| 1360 |
function getMenuCount ($type, $published) { |
function getMenuCount ($type, $published) { |
| 1361 |
if (isset($this->_counts[$type][$published])) return $this->_counts[$type][$published]; |
if (isset($this->_counts[$type][$published])) return $this->_counts[$type][$published]; |
| 1362 |
else return 0; |
else return 0; |
| 1363 |
} |
} |
| 1364 |
|
|
| 1365 |
|
/** |
| 1366 |
|
* Enter description here... |
| 1367 |
|
* |
| 1368 |
|
* @param unknown_type $types |
| 1369 |
|
* @return unknown |
| 1370 |
|
*/ |
| 1371 |
function &getMenusByType ($types) { |
function &getMenusByType ($types) { |
| 1372 |
$checker = explode(',', $types); |
$checker = explode(',', $types); |
| 1373 |
$result = null; |
$result = null; |
| 1377 |
return $result; |
return $result; |
| 1378 |
} |
} |
| 1379 |
|
|
| 1380 |
|
/** |
| 1381 |
|
* Enter description here... |
| 1382 |
|
* |
| 1383 |
|
* @return unknown |
| 1384 |
|
*/ |
| 1385 |
function &getMenuTypes () { |
function &getMenuTypes () { |
| 1386 |
$types = array(); |
$types = array(); |
| 1387 |
foreach ($this->_menus as $menu) { |
foreach ($this->_menus as $menu) { |
| 1391 |
return $types; |
return $types; |
| 1392 |
} |
} |
| 1393 |
|
|
| 1394 |
|
/** |
| 1395 |
|
* Enter description here... |
| 1396 |
|
* |
| 1397 |
|
* @param unknown_type $type |
| 1398 |
|
* @param unknown_type $link |
| 1399 |
|
* @return unknown |
| 1400 |
|
*/ |
| 1401 |
function getIDByTypeLink ($type, $link) { |
function getIDByTypeLink ($type, $link) { |
| 1402 |
foreach ($this->_menus as $menu) { |
foreach ($this->_menus as $menu) { |
| 1403 |
if ($menu->published == 1 AND ($type == '*' OR $menu->type == $type) AND $menu->link == $link) return $menu->id; |
if ($menu->published == 1 AND ($type == '*' OR $menu->type == $type) AND $menu->link == $link) return $menu->id; |
| 1405 |
return null; |
return null; |
| 1406 |
} |
} |
| 1407 |
|
|
| 1408 |
|
/** |
| 1409 |
|
* Enter description here... |
| 1410 |
|
* |
| 1411 |
|
* @param unknown_type $link |
| 1412 |
|
* @return unknown |
| 1413 |
|
*/ |
| 1414 |
function getIDLikeLink ($link) { |
function getIDLikeLink ($link) { |
| 1415 |
$exact = $this->getIdByTypeLink('*', $link); |
$exact = $this->getIdByTypeLink('*', $link); |
| 1416 |
if ($exact !== null) return $exact; |
if ($exact !== null) return $exact; |
| 1420 |
return 0; |
return 0; |
| 1421 |
} |
} |
| 1422 |
|
|
| 1423 |
|
/** |
| 1424 |
|
* Enter description here... |
| 1425 |
|
* |
| 1426 |
|
* @param unknown_type $type |
| 1427 |
|
* @param unknown_type $componentid |
| 1428 |
|
* @return unknown |
| 1429 |
|
*/ |
| 1430 |
function getIDByTypeCid ($type, $componentid) { |
function getIDByTypeCid ($type, $componentid) { |
| 1431 |
foreach ($this->_menus as $menu) { |
foreach ($this->_menus as $menu) { |
| 1432 |
if ($menu->published == 1 AND $menu->type == $type AND $menu->componentid == $componentid) return $menu->id; |
if ($menu->published == 1 AND $menu->type == $type AND $menu->componentid == $componentid) return $menu->id; |
| 1434 |
return null; |
return null; |
| 1435 |
} |
} |
| 1436 |
|
|
| 1437 |
|
/** |
| 1438 |
|
* Enter description here... |
| 1439 |
|
* |
| 1440 |
|
* @return unknown |
| 1441 |
|
*/ |
| 1442 |
function getGlobalBlogSectionCount () { |
function getGlobalBlogSectionCount () { |
| 1443 |
$count = 0; |
$count = 0; |
| 1444 |
foreach ($this->_menus as $menu) { |
foreach ($this->_menus as $menu) { |
| 1447 |
return $count; |
return $count; |
| 1448 |
} |
} |
| 1449 |
|
|
| 1450 |
|
/** |
| 1451 |
|
* Enter description here... |
| 1452 |
|
* |
| 1453 |
|
* @param unknown_type $Itemid |
| 1454 |
|
* @param unknown_type $type |
| 1455 |
|
* @param unknown_type $id |
| 1456 |
|
* @param unknown_type $catid |
| 1457 |
|
* @return unknown |
| 1458 |
|
*/ |
| 1459 |
function getContentItemid ($Itemid, $type, $id, $catid=0) { |
function getContentItemid ($Itemid, $type, $id, $catid=0) { |
| 1460 |
if ($Itemid) return $Itemid; |
if ($Itemid) return $Itemid; |
| 1461 |
foreach ($this->_menus as $menu) { |
foreach ($this->_menus as $menu) { |
| 1471 |
return 0; |
return 0; |
| 1472 |
} |
} |
| 1473 |
|
|
| 1474 |
|
/** |
| 1475 |
|
* Enter description here... |
| 1476 |
|
* |
| 1477 |
|
* @return unknown |
| 1478 |
|
*/ |
| 1479 |
function getBestQueryMatch () { |
function getBestQueryMatch () { |
| 1480 |
parse_str($_SERVER['QUERY_STRING'], $qitems); |
parse_str($_SERVER['QUERY_STRING'], $qitems); |
| 1481 |
if (!isset($qitems['option'])) return 0; |
if (!isset($qitems['option'])) return 0; |
| 1497 |
} |
} |
| 1498 |
|
|
| 1499 |
|
|
| 1500 |
|
/** |
| 1501 |
|
* Enter description here... |
| 1502 |
|
* |
| 1503 |
|
* @param unknown_type $link |
| 1504 |
|
* @return unknown |
| 1505 |
|
*/ |
| 1506 |
function &maxAccessLink ($link) { |
function &maxAccessLink ($link) { |
| 1507 |
$selected = null; |
$selected = null; |
| 1508 |
$access = 0; |
$access = 0; |
| 1515 |
return $selected; |
return $selected; |
| 1516 |
} |
} |
| 1517 |
|
|
| 1518 |
|
/** |
| 1519 |
|
* Enter description here... |
| 1520 |
|
* |
| 1521 |
|
* @param unknown_type $Itemid |
| 1522 |
|
* @param unknown_type $menutype |
| 1523 |
|
* @param unknown_type $maxaccess |
| 1524 |
|
* @param unknown_type $noparent |
| 1525 |
|
* @return unknown |
| 1526 |
|
*/ |
| 1527 |
function &getByParentOrder ($Itemid, $menutype, $maxaccess=0, $noparent=false) { |
function &getByParentOrder ($Itemid, $menutype, $maxaccess=0, $noparent=false) { |
| 1528 |
$result = array(); |
$result = array(); |
| 1529 |
if ($this->_byParentOrder !== null) { |
if ($this->_byParentOrder !== null) { |
| 1544 |
return $result; |
return $result; |
| 1545 |
} |
} |
| 1546 |
|
|
| 1547 |
|
/** |
| 1548 |
|
* Enter description here... |
| 1549 |
|
* |
| 1550 |
|
* @param unknown_type $Itemid |
| 1551 |
|
*/ |
| 1552 |
function setPathway ($Itemid) { |
function setPathway ($Itemid) { |
| 1553 |
if ($Itemid) { |
if ($Itemid) { |
| 1554 |
$menu =& $this->getMenuByID($Itemid); |
$menu =& $this->getMenuByID($Itemid); |
| 1589 |
return isset($access) ? $access <= $gid : false; |
return isset($access) ? $access <= $gid : false; |
| 1590 |
} |
} |
| 1591 |
|
|
| 1592 |
|
/** |
| 1593 |
|
* Enter description here... |
| 1594 |
|
* |
| 1595 |
|
* @param unknown_type $mitem |
| 1596 |
|
* @param unknown_type $level |
| 1597 |
|
* @param unknown_type $params |
| 1598 |
|
* @param unknown_type $Itemid |
| 1599 |
|
* @return unknown |
| 1600 |
|
*/ |
| 1601 |
function mosGetMenuLink( &$mitem, $level=0, &$params, $Itemid ) { |
function mosGetMenuLink( &$mitem, $level=0, &$params, $Itemid ) { |
| 1602 |
$txt = ''; |
$txt = ''; |
| 1603 |
|
|