function smarty_function_viewfile($params, &$smarty)
{
    $view = exponent_template_getViewFile("modules", $params['module'], $params['view']);
    $smarty->assign($params['var'], $view);
}
 function standalonetemplate($view)
 {
     include_once BASE . 'external/Smarty/libs/Smarty.class.php';
     $this->tpl = new Smarty();
     //$this->tpl->security = true;
     $this->tpl->php_handling = SMARTY_PHP_REMOVE;
     $this->tpl->plugins_dir[] = BASE . 'subsystems/template/Smarty/plugins';
     $file = exponent_template_getViewFile("", "", $view);
     $this->view = substr(basename($file), 0, -4);
     $this->viewdir = str_replace(BASE, '', realpath(dirname($file)));
     $this->tpl->template_dir = $this->viewdir;
     // Make way for i18n
     // $this->tpl->compile_dir = $this->viewdir."_c";
     $this->tpl->compile_dir = BASE . '/tmp/views_c';
     $this->tpl->compile_id = md5($this->viewfile);
     $this->tpl->assign("__view", $view);
     $this->tpl->assign("__redirect", exponent_flow_get());
 }
# This file is part of Exponent
#
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
if (!defined('EXPONENT')) {
    exit('');
}
if (exponent_permissions_check('administrate', $loc)) {
    if (exponent_template_getViewFile("modules", $loc->mod, '_userpermissions') == TEMPLATE_FALLBACK_VIEW) {
        $template = new template('common', '_userpermissions', $loc);
    } else {
        $template = new template($loc->mod, '_userpermissions', $loc);
    }
    $template->assign('user_form', 1);
    if (!defined('SYS_USERS')) {
        include_once BASE . 'subsystems/users.php';
    }
    $users = array();
    $modclass = $loc->mod;
    $mod = new $modclass();
    $perms = $mod->permissions($loc->int);
    $have_users = 0;
    foreach (exponent_users_getAllUsers(0) as $u) {
        $have_users = 1;
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
if (!defined("EXPONENT")) {
    exit("");
}
$mloc = exponent_core_makeLocation($_GET['orig_module'], $loc->src, $loc->int);
if (exponent_permissions_check('manage_categories', $mloc)) {
    exponent_flow_set(SYS_FLOW_PROTECTED, SYS_FLOW_ACTION);
    $categories = $db->selectObjects("category", "location_data='" . serialize($mloc) . "'");
    if (exponent_template_getViewFile("modules", $mloc->mod, "_cat_manageCategories") == TEMPLATE_FALLBACK_VIEW) {
        $template = new template("categories", "_cat_manageCategories", $loc);
    } else {
        $template = new template($mloc->mod, "_cat_manageCategories", $loc);
    }
    if (!defined('SYS_SORTING')) {
        include_once BASE . 'subsystems/sorting.php';
    }
    usort($categories, "exponent_sorting_byRankAscending");
    $template->assign("origmodule", $_GET['orig_module']);
    $template->assign("categories", $categories);
    $template->output();
} else {
    echo SITE_403_HTML;
}
# This file is part of Exponent
#
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
if (!defined('EXPONENT')) {
    exit('');
}
if (exponent_permissions_check('configure', $loc)) {
    if (exponent_template_getViewFile("modules", $loc->mod, '_configure') == TEMPLATE_FALLBACK_VIEW) {
        $template = new template('common', '_configure', $loc);
    } else {
        $template = new template($loc->mod, '_configure', $loc);
    }
    $hasConfig = 0;
    $submit = null;
    $form = null;
    if ($db->tableExists($_GET['module'] . '_config') && class_exists($_GET['module'] . '_config')) {
        $config = $db->selectObject($_GET['module'] . '_config', "location_data='" . serialize($loc) . "'");
        $form = call_user_func(array($_GET['module'] . '_config', 'form'), $config);
        if (isset($form->controls['submit'])) {
            $submit = $form->controls['submit'];
            $form->unregister('submit');
        }
        $hasConfig = 1;