Esempio n. 1
0
/**
 * Smarty {viewfile} function plugin
 *
 * Type:     function<br>
 * Name:     viewfile<br>
 * Purpose:  get and assign a view file
 *
 * @param         $params
 * @param \Smarty $smarty
 * @return bool
 */
function smarty_function_viewfile($params, &$smarty)
{
    $view = expTemplate::getModuleViewFile($params['module'], $params['view']);
    $smarty->assign($params['var'], $view);
}
Esempio n. 2
0
# 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
#
##################################################
/** @define "BASE" "../../../.." */
if (!defined('EXPONENT')) {
    exit('');
}
//if (expPermissions::check('administrate',$loc)) {
if ($user->isAdmin()) {
    global $router;
    if (expTemplate::getModuleViewFile($loc->mod, '_userpermissions', false) == TEMPLATE_FALLBACK_VIEW) {
        $template = new template('common', '_userpermissions', $loc);
    } else {
        //TODO
        //ADK - I hard coded the common module name into the new template declaration since the path resolver
        // can't seem to figure out that we are in the common module and not the module that call this action.
        //$template = new template($loc->mod,'_userpermissions',$loc);
        $template = new template('common', '_userpermissions', $loc);
    }
    $template->assign('user_form', 1);
    $users = array();
    $modulename = expModules::controllerExists($loc->mod) ? expModules::getControllerClassName($loc->mod) : $loc->mod;
    $modclass = $modulename;
    $mod = new $modclass();
    $perms = $mod->permissions($loc->int);
    $have_users = 0;
Esempio n. 3
0
# 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 (expPermissions::check('configure', $loc)) {
    if (expTemplate::getModuleViewFile($loc->mod, '_configure', false) == TEMPLATE_FALLBACK_VIEW) {
        $template = new template('common', '_configure', $loc);
    } else {
        $template = new template('common', '_configure', $loc);
        //$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) . "'");
        if (empty($config->location_data)) {
            $config->location_data = serialize($loc);
        }
        $form = call_user_func(array($_GET['module'] . '_config', 'form'), $config);
        if (isset($form->controls['submit'])) {