##  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA ##
###############################################################################
##  Author of this file: Freeform Solutions                                  ##
##  URL: http://www.freeformsolutions.ca/formulize                           ##
##  Project: Formulize                                                       ##
###############################################################################
// this file gets all the data about a particular page of a screen, so it can be edited
require_once "../../../mainfile.php";
include_once XOOPS_ROOT_PATH . "/modules/formulize/include/functions.php";
include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
// setup a smarty object that we can use for templating our own pages
require_once XOOPS_ROOT_PATH . '/class/template.php';
require_once XOOPS_ROOT_PATH . '/class/theme.php';
require_once XOOPS_ROOT_PATH . '/class/theme_blocks.php';
$xoopsThemeFactory = new xos_opal_ThemeFactory();
$xoTheme =& $xoopsThemeFactory->createInstance();
$xoopsTpl =& $xoTheme->template;
$pageIndex = intval($_GET['page']);
$sid = intval($_GET['sid']);
$screen_handler = xoops_getmodulehandler('multiPageScreen', 'formulize');
$screen = $screen_handler->get($sid);
if (!is_object($screen)) {
    return "Error: could not load information for the specified page";
}
// setup all the elements in this form for use in the listboxes
include_once XOOPS_ROOT_PATH . "/modules/formulize/class/forms.php";
$fid = $screen->getVar('fid');
$options = multiPageScreen_addToOptionsList($fid, array());
// add in elements from other forms in the framework, by looping through each link in the framework and checking if it is a display as one, one-to-one link
// added March 20 2008, by jwe
$frid = $screen->getVar("frid");
Пример #2
0
            $allowed = true;
            break;
        }
    }
} elseif (!empty($_POST['xoops_login'])) {
    include_once $GLOBALS['xoops']->path('include/checklogin.php');
    exit;
}
if (!$allowed) {
    require_once $GLOBALS['xoops']->path('class/template.php');
    require_once $GLOBALS['xoops']->path('class/theme.php');
    $xoopsThemeFactory = null;
    $xoopsThemeFactory = new xos_opal_ThemeFactory();
    $xoopsThemeFactory->allowedThemes = $xoopsConfig['theme_set_allowed'];
    $xoopsThemeFactory->defaultTheme = $xoopsConfig['theme_set'];
    $xoTheme = $xoopsThemeFactory->createInstance(array('plugins' => array()));
    $xoTheme->addScript('/include/xoops.js', array('type' => 'text/javascript'));
    $xoopsTpl = $xoTheme->template;
    $xoopsTpl->assign(array('xoops_theme' => $xoopsConfig['theme_set'], 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/', 'xoops_themecss' => xoops_getcss($xoopsConfig['theme_set']), 'xoops_requesturi' => htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES), 'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES), 'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES), 'xoops_dirname' => @$xoopsModule ? $xoopsModule->getVar('dirname') : 'system', 'xoops_banner' => $xoopsConfig['banners'] ? xoops_getbanner() : ' ', 'xoops_pagetitle' => isset($xoopsModule) && is_object($xoopsModule) ? $xoopsModule->getVar('name') : htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES), 'lang_login' => _LOGIN, 'lang_username' => _USERNAME, 'lang_password' => _PASSWORD, 'lang_siteclosemsg' => $xoopsConfig['closesite_text']));
    $config_handler = xoops_getHandler('config');
    $criteria = new CriteriaCompo(new Criteria('conf_modid', 0));
    $criteria->add(new Criteria('conf_catid', XOOPS_CONF_METAFOOTER));
    $config = $config_handler->getConfigs($criteria, true);
    foreach (array_keys($config) as $i) {
        $name = $config[$i]->getVar('conf_name', 'n');
        $value = $config[$i]->getVar('conf_value', 'n');
        if (substr($name, 0, 5) === 'meta_') {
            $xoopsTpl->assign("xoops_{$name}", htmlspecialchars($value, ENT_QUOTES));
        } else {
            // prefix each tag with 'xoops_'
            $xoopsTpl->assign("xoops_{$name}", $value);
Пример #3
0
/**
 * Function to redirect a user to certain pages
 */
function redirect_header($url, $time = 3, $message = '', $addredirect = true, $allowExternalLink = false)
{
    global $xoopsConfig, $xoopsLogger, $xoopsUserIsAdmin;
    $xoopsPreload =& XoopsPreload::getInstance();
    $xoopsPreload->triggerEvent('core.include.functions.redirectheader', array($url, $time, $message, $addredirect, $allowExternalLink));
    if (preg_match("/[\\0-\\31]|about:|script:/i", $url)) {
        if (!preg_match('/^\\b(java)?script:([\\s]*)history\\.go\\(-[0-9]*\\)([\\s]*[;]*[\\s]*)$/si', $url)) {
            $url = XOOPS_URL;
        }
    }
    if (!$allowExternalLink && ($pos = strpos($url, '://'))) {
        $xoopsLocation = substr(XOOPS_URL, strpos(XOOPS_URL, '://') + 3);
        if (strcasecmp(substr($url, $pos + 3, strlen($xoopsLocation)), $xoopsLocation)) {
            $url = XOOPS_URL;
        }
    }
    if (defined('XOOPS_CPFUNC_LOADED')) {
        $theme = 'default';
    } else {
        $theme = $xoopsConfig['theme_set'];
    }
    require_once XOOPS_ROOT_PATH . '/class/template.php';
    require_once XOOPS_ROOT_PATH . '/class/theme.php';
    $xoopsThemeFactory = null;
    $xoopsThemeFactory = new xos_opal_ThemeFactory();
    $xoopsThemeFactory->allowedThemes = $xoopsConfig['theme_set_allowed'];
    $xoopsThemeFactory->defaultTheme = $theme;
    $xoTheme =& $xoopsThemeFactory->createInstance(array("plugins" => array(), "renderBanner" => false));
    $xoopsTpl =& $xoTheme->template;
    $xoopsTpl->assign(array('xoops_theme' => $theme, 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $theme . '/', 'xoops_themecss' => xoops_getcss($theme), 'xoops_requesturi' => htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES), 'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES), 'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES), 'xoops_dirname' => isset($xoopsModule) && is_object($xoopsModule) ? $xoopsModule->getVar('dirname') : 'system', 'xoops_pagetitle' => isset($xoopsModule) && is_object($xoopsModule) ? $xoopsModule->getVar('name') : htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
    if ($xoopsConfig['debug_mode'] == 2 && $xoopsUserIsAdmin) {
        $xoopsTpl->assign('time', 300);
        $xoopsTpl->assign('xoops_logdump', $xoopsLogger->dump());
    } else {
        $xoopsTpl->assign('time', intval($time));
    }
    if (!empty($_SERVER['REQUEST_URI']) && $addredirect && strstr($url, 'user.php')) {
        if (!strstr($url, '?')) {
            $url .= '?xoops_redirect=' . urlencode($_SERVER['REQUEST_URI']);
        } else {
            $url .= '&xoops_redirect=' . urlencode($_SERVER['REQUEST_URI']);
        }
    }
    if (defined('SID') && SID && (!isset($_COOKIE[session_name()]) || $xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '' && !isset($_COOKIE[$xoopsConfig['session_name']]))) {
        if (!strstr($url, '?')) {
            $url .= '?' . SID;
        } else {
            $url .= '&' . SID;
        }
    }
    $url = preg_replace("/&/i", '&', htmlspecialchars($url, ENT_QUOTES));
    $xoopsTpl->assign('url', $url);
    $message = trim($message) != '' ? $message : _TAKINGBACK;
    $xoopsTpl->assign('message', $message);
    $xoopsTpl->assign('lang_ifnotreload', sprintf(_IFNOTRELOAD, $url));
    $xoopsTpl->display('db:system_redirect.html');
    exit;
}
Пример #4
0
if (!isset($xoopsTpl)) {
    global $xoopsOption, $xoopsConfig, $xoopsModule;
    $xoopsOption['theme_use_smarty'] = 1;
    // include Smarty template engine and initialize it
    require_once XOOPS_ROOT_PATH . '/class/template.php';
    require_once XOOPS_ROOT_PATH . '/class/theme.php';
    require_once XOOPS_ROOT_PATH . '/class/theme_blocks.php';
    if (@$xoopsOption['template_main']) {
        if (false === strpos($xoopsOption['template_main'], ':')) {
            $xoopsOption['template_main'] = 'db:' . $xoopsOption['template_main'];
        }
    }
    $xoopsThemeFactory = new xos_opal_ThemeFactory();
    $xoopsThemeFactory->allowedThemes = $xoopsConfig['theme_set_allowed'];
    $xoopsThemeFactory->defaultTheme = $xoopsConfig['theme_set'];
    $xoTheme =& $xoopsThemeFactory->createInstance(array('contentTemplate' => @$xoopsOption['template_main']));
    $xoopsTpl =& $xoTheme->template;
}
// handle any operations requested as part of this page load
// sets up a template variable with the results of the op, called opResults
include_once "op.php";
// create the contents that we want to display for the currently selected page
// the included php files create the values for $adminPage that are used for this page
$adminPage = array();
$active_page = isset($_GET['page']) ? $_GET['page'] : "home";
switch ($active_page) {
    case "application":
        include "application.php";
        break;
    case "form":
        include "form.php";
Пример #5
0
 /**
  * Gets an instance of XoopsTpl if exists, or create a new one if not.
  * @return XoopsTpl
  */
 public function xo_tpl()
 {
     global $xoopsTpl, $xoopsConfig;
     if (is_a($xoopsTpl, 'XoopsTpl')) {
         return $xoopsTpl;
     }
     // include Smarty template engine and initialize it
     require_once $GLOBALS['xoops']->path('class/template.php');
     require_once $GLOBALS['xoops']->path('class/theme.php');
     require_once $GLOBALS['xoops']->path('class/theme_blocks.php');
     $xoopsThemeFactory = null;
     $xoopsThemeFactory = new xos_opal_ThemeFactory();
     $xoopsThemeFactory->allowedThemes = $xoopsConfig['theme_set_allowed'];
     $xoopsThemeFactory->defaultTheme = $xoopsConfig['theme_set'];
     $xoTheme =& $xoopsThemeFactory->createInstance(array('contentTemplate' => @$xoopsOption['template_main']));
     $xoopsTpl =& $xoTheme->template;
     return $xoopsTpl;
 }
Пример #6
0
 /**
  * @param array $options
  * @param array $initArgs
  *
  * @return null|xos_opal_Theme
  */
 public function &createInstance($options = array(), $initArgs = array())
 {
     $options['plugins'] = array();
     $options['renderBanner'] = false;
     $inst = parent::createInstance($options, $initArgs);
     $inst->path = XOOPS_ADMINTHEME_PATH . '/' . $inst->folderName;
     $inst->url = XOOPS_ADMINTHEME_URL . '/' . $inst->folderName;
     $inst->template->assign(array('theme_path' => $inst->path, 'theme_tpl' => $inst->path . '/xotpl', 'theme_url' => $inst->url, 'theme_img' => $inst->url . '/img', 'theme_icons' => $inst->url . '/icons', 'theme_css' => $inst->url . '/css', 'theme_js' => $inst->url . '/js', 'theme_lang' => $inst->url . '/language'));
     return $inst;
 }
Пример #7
0
 function &createInstance($options = array(), $initArgs = array())
 {
     $options["plugins"] = array();
     $inst =& parent::createInstance($options, $initArgs);
     $inst->path = XOOPS_ROOT_PATH . '/modules/system/class/gui/' . $inst->folderName;
     $inst->url = XOOPS_URL . '/modules/system/class/gui/' . $inst->folderName;
     $inst->template->assign(array('theme_path' => $inst->path, 'theme_tpl' => $inst->path . '/xotpl', 'theme_url' => $inst->url, 'theme_img' => $inst->url . '/img', 'theme_icons' => $inst->url . '/icons', 'theme_css' => $inst->url . '/css', 'theme_js' => $inst->url . '/js', 'theme_lang' => $inst->url . '/language'));
     return $inst;
 }