Example #1
0
if ($config->get('multiLanguageSupport') && count($args)) {
    $language = array_shift($args);
} else {
    $language = _DEFAULT_LANGUAGE_;
}
$lang = new language($language, _DEFAULT_SITE_, true);
$user = new currentUser();
$manager = new pluginManager();
$tree = new pageTree($user, $manager, $language, _DEFAULT_SITE_);
if (count($args) > 0) {
    // First check our pretty URL hashes
    $url = implode('/', $args);
    $url = preg_replace('/\\.([a-z0-9]+)$/i', '', $url);
    if (isset($GLOBALS['HASH_IDS'][$url])) {
        $id = $GLOBALS['HASH_IDS'][$url];
        $manager->handleAction('view', array($id));
        exit;
    }
    // Secondly handle an action
    $action = array_shift($args);
    $manager->handleAction($action, $args);
    exit;
} else {
    $manager->handleAction('view', array());
}
// Decode argument and import
// them into the global scope
function removeslashes($v)
{
    if (is_array($v)) {
        $v = array_map('removeslashes', $v);