| 192 |
if (file_exists($language_file)) require_once ($language_file); |
if (file_exists($language_file)) require_once ($language_file); |
| 193 |
################################### |
################################### |
| 194 |
|
|
| 195 |
//set_error_handler('error_handler'); |
#set_error_handler('error_handler'); |
| 196 |
$lang = $this->mosConfig_lang; |
$lang = $this->mosConfig_lang; |
| 197 |
|
|
| 198 |
|
|
| 199 |
$langfile = $this->rootPath.DIRECTORY_SEPARATOR.'language'.DIRECTORY_SEPARATOR.$lang.'.xml'; |
$langfile = $this->rootPath.DIRECTORY_SEPARATOR.'language'.DIRECTORY_SEPARATOR.$lang.'.xml'; |
| 200 |
|
/*$this->language[$this->mosConfig_language] = array( |
| 201 |
|
'locale' => 'pt, pt.utf-8', |
| 202 |
|
'encoding' => 'utf-8', |
| 203 |
|
'direction' => 'rtl', |
| 204 |
|
'dateformat' => '%A, %d %B %Y', |
| 205 |
|
'offset' => '+00:00' |
| 206 |
|
); |
| 207 |
|
*/ |
| 208 |
$p = xml_parser_create(); |
$p = xml_parser_create(); |
| 209 |
xml_parser_set_option($p, XML_OPTION_CASE_FOLDING, 0); |
xml_parser_set_option($p, XML_OPTION_CASE_FOLDING, 0); |
| 210 |
xml_parser_set_option($p, XML_OPTION_SKIP_WHITE, 1); |
xml_parser_set_option($p, XML_OPTION_SKIP_WHITE, 1); |
| 218 |
} |
} |
| 219 |
} |
} |
| 220 |
|
|
| 221 |
|
|
| 222 |
if (!defined('_ISO')) DEFINE('_ISO','charset='.$this->language['encoding']); |
if (!defined('_ISO')) DEFINE('_ISO','charset='.$this->language['encoding']); |
| 223 |
if (!defined('_DATE_FORMAT_LC')) DEFINE('_DATE_FORMAT_LC', $this->language['dateformat']); //Uses PHP's strftime Command Format |
if (!defined('_DATE_FORMAT_LC')) DEFINE('_DATE_FORMAT_LC', $this->language['dateformat']); //Uses PHP's strftime Command Format |
| 224 |
if (!defined('_DATE_FORMAT_LC2')) DEFINE('_DATE_FORMAT_LC2', $this->language['dateformat']." %H:%M"); |
if (!defined('_DATE_FORMAT_LC2')) DEFINE('_DATE_FORMAT_LC2', $this->language['dateformat']." %H:%M"); |
| 225 |
|
|
| 226 |
//header('Content-Type: text/html; charset=utf-8'); |
//header('Content-Type: text/html; charset=utf-8'); |
|
$domain = $this->mosConfig_lang; |
|
|
$textdomain = $this->rootPath.'/language'; |
|
| 227 |
$gettext =& phpgettext(); |
$gettext =& phpgettext(); |
| 228 |
$gettext->debug = 0; |
$gettext->debug = 0; |
| 229 |
$gettext->has_gettext = 0; |
$gettext->has_gettext = 0; |
| 230 |
$gettext->setlocale($name); |
$gettext->setlocale($this->mosConfig_lang, $this->mosConfig_locale); |
| 231 |
setlocale(LC_ALL, $this->language['locale']); |
/*dump($gettext->getlocale()); |
| 232 |
setlocale(LC_CTYPE, $this->language['encoding']); |
$gettext->bindtextdomain('administrator', $lang_path);/*dump($gettext->getlocale()); |
| 233 |
$gettext->bindtextdomain($domain, $textdomain); |
dump(setlocale(LC_CTYPE, ''));; |
| 234 |
$gettext->bind_textdomain_codeset($domain, $this->language['encoding']); |
|
| 235 |
$gettext->textdomain($domain); |
|
| 236 |
/**/ |
dump(array($gettext, $this));*/ |
| 237 |
|
|
| 238 |
} |
} |
| 239 |
|
|
| 240 |
function handleGlobals () { |
function handleGlobals () { |
| 2390 |
$local_backup_path = $configuration->rootPath().'/administrator/backups'; |
$local_backup_path = $configuration->rootPath().'/administrator/backups'; |
| 2391 |
$media_path = $configuration->rootPath().'/media/'; |
$media_path = $configuration->rootPath().'/media/'; |
| 2392 |
$image_path = $configuration->rootPath().'/images/stories'; |
$image_path = $configuration->rootPath().'/images/stories'; |
| 2393 |
|
$lang_path = $configuration->rootPath().'/language'; |
| 2394 |
$image_size = 100; |
$image_size = 100; |
| 2395 |
|
|
| 2396 |
$database =& mamboDatabase::getInstance(); |
$database =& mamboDatabase::getInstance(); |
| 2397 |
$database->debug(mamboCore::get('mosConfig_debug')); |
$database->debug(mamboCore::get('mosConfig_debug')); |
| 2398 |
|
|
| 2399 |
|
// |
| 2400 |
|
|
| 2401 |
|
$gettext =& phpgettext(); |
| 2402 |
|
$gettext->bindtextdomain('common', $configuration->rootPath().'/language'); |
| 2403 |
|
$gettext->textdomain('common'); |
| 2404 |
|
//dump($gettext->textdomain(substr($option, 3))); |
| 2405 |
|
//$gettext->bindtextdomain('frontend', $lang_path); |
| 2406 |
|
//$gettext->textdomain('frontend'); |
| 2407 |
|
|
| 2408 |
if (!$adminside) { |
if (!$adminside) { |
| 2409 |
$sefcode = $configuration->rootPath().'/components/com_sef/sef.php'; |
$sefcode = $configuration->rootPath().'/components/com_sef/sef.php'; |
| 2410 |
if (file_exists($sefcode)) require_once($sefcode); |
if (file_exists($sefcode)) require_once($sefcode); |
| 2434 |
$acl = new gacl_api(); |
$acl = new gacl_api(); |
| 2435 |
// Handle special admin side options |
// Handle special admin side options |
| 2436 |
$option = strtolower(mosGetParam($_REQUEST,'option','com_admin')); |
$option = strtolower(mosGetParam($_REQUEST,'option','com_admin')); |
| 2437 |
|
|
| 2438 |
|
$domain = substr($option, 4); |
| 2439 |
|
$gettext->bindtextdomain('administrator', $lang_path); |
| 2440 |
|
$gettext->bindtextdomain($domain, $lang_path); |
| 2441 |
|
$admindomain = $gettext->textdomain(); |
| 2442 |
|
$gettext->textdomain('administrator'); |
| 2443 |
// Login will, if it succeeds, start a new session and set $my |
// Login will, if it succeeds, start a new session and set $my |
| 2444 |
if ($option == 'login') { |
if ($option == 'login') { |
| 2445 |
require_once($configuration->rootPath().'/includes/authenticator.php'); |
require_once($configuration->rootPath().'/includes/authenticator.php'); |
| 2466 |
// We can now create the mainframe object |
// We can now create the mainframe object |
| 2467 |
$mainframe =& new mosMainFrame($database, $option, '..', true); |
$mainframe =& new mosMainFrame($database, $option, '..', true); |
| 2468 |
// Provided $my is set, we have a valid admin side session and can include remaining code |
// Provided $my is set, we have a valid admin side session and can include remaining code |
| 2469 |
|
|
| 2470 |
if ($my) { |
if ($my) { |
| 2471 |
mamboCore::set('currentUser', $my); |
mamboCore::set('currentUser', $my); |
| 2472 |
require_once( $configuration->rootPath().'/includes/mambo.php' ); |
require_once( $configuration->rootPath().'/includes/mambo.php' ); |
| 2476 |
require_once($configuration->rootPath().'/administrator/includes/admin.php'); |
require_once($configuration->rootPath().'/administrator/includes/admin.php'); |
| 2477 |
require_once( $configuration->rootPath() . '/includes/cmtclasses.php' ); |
require_once( $configuration->rootPath() . '/includes/cmtclasses.php' ); |
| 2478 |
$_MAMBOTS =& mosMambotHandler::getInstance(); |
$_MAMBOTS =& mosMambotHandler::getInstance(); |
| 2479 |
|
|
| 2480 |
|
|
| 2481 |
// If no_html is set, we avoid starting the template, and go straight to the component |
// If no_html is set, we avoid starting the template, and go straight to the component |
| 2482 |
if ($no_html) { |
if ($no_html) { |
| 2483 |
if ($path = $mainframe->getPath( "admin" )) require $path; |
if ($path = $mainframe->getPath( "admin" )) require $path; |
| 2491 |
$configuration->doGzip(); |
$configuration->doGzip(); |
| 2492 |
} |
} |
| 2493 |
else { |
else { |
| 2494 |
|
if (!$popup) { |
| 2495 |
$pop = mosGetParam($_REQUEST, 'pop', ''); |
$pop = mosGetParam($_REQUEST, 'pop', ''); |
| 2496 |
if ($pop) require_once($configuration->rootPath()."/administrator/popups/$pop"); |
if ($pop) require_once($configuration->rootPath()."/administrator/popups/$pop"); |
| 2497 |
else require_once($configuration->rootPath()."/administrator/popups/index3pop.php"); |
else require_once($configuration->rootPath()."/administrator/popups/index3pop.php"); |
| 2498 |
$configuration->doGzip(); |
$configuration->doGzip(); |
| 2499 |
} |
} |
| 2500 |
} |
} |
| 2501 |
|
} |
| 2502 |
// If $my was not set, the only possibility is to ask for an admin side login |
// If $my was not set, the only possibility is to ask for an admin side login |
| 2503 |
else { |
else { |
| 2504 |
$configuration->initGzip(); |
$configuration->initGzip(); |
| 2513 |
$configuration->handleGlobals(); |
$configuration->handleGlobals(); |
| 2514 |
$Itemid = $configuration->get('Itemid'); |
$Itemid = $configuration->get('Itemid'); |
| 2515 |
|
|
| 2516 |
|
// load frontend language file |
| 2517 |
|
$gettext->bindtextdomain(substr($option, 4), $configuration->rootPath().'/language'); |
| 2518 |
|
$gettext->bindtextdomain('frontend', $configuration->rootPath().'/language'); |
| 2519 |
|
$frontdomain = $gettext->textdomain(); |
| 2520 |
|
$gettext->textdomain('frontend'); |
| 2521 |
|
|
| 2522 |
|
|
| 2523 |
$mainframe =& new mosMainFrame($database, $option, '.'); |
$mainframe =& new mosMainFrame($database, $option, '.'); |
| 2524 |
if ($option == 'login') $configuration->handleLogin(); |
if ($option == 'login') $configuration->handleLogin(); |
| 2525 |
elseif ($option == 'logout') $configuration->handleLogout(); |
elseif ($option == 'logout') $configuration->handleLogout(); |
| 2553 |
require_once( $configuration->rootPath() . '/includes/gacl_api.class.php' ); |
require_once( $configuration->rootPath() . '/includes/gacl_api.class.php' ); |
| 2554 |
$acl = new gacl_api(); |
$acl = new gacl_api(); |
| 2555 |
|
|
| 2556 |
|
|
| 2557 |
/** Get the component handler */ |
/** Get the component handler */ |
| 2558 |
require_once( $configuration->rootPath() . '/includes/cmtclasses.php' ); |
require_once( $configuration->rootPath() . '/includes/cmtclasses.php' ); |
| 2559 |
$c_handler =& mosComponentHandler::getInstance(); |
$c_handler =& mosComponentHandler::getInstance(); |
| 2563 |
$menuhandler =& mosMenuHandler::getInstance(); |
$menuhandler =& mosMenuHandler::getInstance(); |
| 2564 |
$ret = $menuhandler->menuCheck($Itemid, $option, $task, $gid); |
$ret = $menuhandler->menuCheck($Itemid, $option, $task, $gid); |
| 2565 |
$menuhandler->setPathway($Itemid); |
$menuhandler->setPathway($Itemid); |
| 2566 |
if ($ret) require_once( $path ); |
if ($ret) { |
| 2567 |
|
$gettext->textdomain(substr($option, 4)); // get the component lang file |
| 2568 |
|
require_once( $path ); |
| 2569 |
|
$gettext->textdomain($frontdomain); |
| 2570 |
|
} |
| 2571 |
else mosNotAuth(); |
else mosNotAuth(); |
| 2572 |
} |
} |
| 2573 |
else { |
else { |