# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307  USA
#
# $Id: manage.php,v 1.9 2005/04/18 15:22:30 filetreefrog Exp $
##################################################
if (!defined("PATHOS")) {
    exit("");
}
$mloc = pathos_core_makeLocation($_GET['orig_module'], $loc->src, $loc->int);
if (pathos_permissions_check('manage_categories', $mloc)) {
    pathos_flow_set(SYS_FLOW_PROTECTED, SYS_FLOW_ACTION);
    $categories = $db->selectObjects("category", "location_data='" . serialize($mloc) . "'");
    if (pathos_template_getModuleViewFile($mloc->mod, "_cat_manageCategories", false) == TEMPLATE_FALLBACK_VIEW) {
        $template = new template("categories", "_cat_manageCategories", $loc);
    } else {
        $template = new template($mloc->mod, "_cat_manageCategories", $loc);
    }
    if (!defined('SYS_SORTING')) {
        require_once BASE . 'subsystems/sorting.php';
    }
    usort($categories, "pathos_sorting_byRankAscending");
    $template->assign("origmodule", $_GET['orig_module']);
    $template->assign("categories", $categories);
    $template->output();
} else {
    echo SITE_403_HTML;
}
Exemple #2
0
 function template($module, $view = null, $loc = null, $caching = false)
 {
     // Set up the Smarty template variable we wrap around.
     $this->tpl = new Smarty();
     $this->tpl->php_handling = SMARTY_PHP_REMOVE;
     $this->tpl->plugins_dir[] = BASE . "plugins";
     $this->viewfile = pathos_template_getModuleViewFile($module, $view);
     $this->viewparams = pathos_template_getViewParams($this->viewfile);
     $this->viewdir = realpath(dirname($this->viewfile));
     $this->view = substr(basename($this->viewfile), 0, -4);
     $this->tpl->template_dir = $this->viewdir;
     // Make way for i18n
     // $this->tpl->compile_dir = $this->viewdir."_c";
     $this->tpl->compile_dir = BASE . '/views_c';
     $this->tpl->compile_id = md5($this->viewfile);
     $expected_view = $this->viewfile == TEMPLATE_FALLBACK_VIEW ? $view : $this->view;
     $this->tpl->assign("__view", $expected_view);
     if ($loc == null) {
         $loc = pathos_core_makeLocation($module);
     }
     $this->tpl->assign("__loc", $loc);
     $this->tpl->assign("__redirect", pathos_flow_get());
     // View Config
     global $db;
     $container = $db->selectObject("container", "internal='" . serialize($loc) . "'");
     $this->viewconfig = $container && $container->view_data != "" ? unserialize($container->view_data) : array();
     $this->tpl->assign("__viewconfig", $this->viewconfig);
 }
# You should have received a copy of the GNU
# General Public License along with Exponent; if
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307  USA
#
# $Id: configure.php,v 1.10 2005/04/18 15:22:39 filetreefrog Exp $
##################################################
if (!defined('PATHOS')) {
    exit('');
}
if (pathos_permissions_check('configure', $loc)) {
    if (pathos_template_getModuleViewFile($loc->mod, '_configure', false) == 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;
# You should have received a copy of the GNU
# General Public License along with Exponent; if
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307  USA
#
# $Id: userperms.php,v 1.4 2005/04/18 15:22:39 filetreefrog Exp $
##################################################
if (!defined("PATHOS")) {
    exit("");
}
if (pathos_permissions_check("administrate", $loc)) {
    if (pathos_template_getModuleViewFile($loc->mod, "_userpermissions", false) == 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")) {
        require_once BASE . "subsystems/users.php";
    }
    $users = array();
    $modclass = $loc->mod;
    $mod = new $modclass();
    $perms = $mod->permissions($loc->int);
    $have_users = 0;
    foreach (pathos_users_getAllUsers(0) as $u) {
Exemple #5
0
function smarty_function_viewfile($params, &$smarty)
{
    $view = pathos_template_getModuleViewFile($params['module'], $params['view']);
    $smarty->assign($params['var'], $view);
}