Example #1
0
 /**
  * Checks whether the site is closed now, and whether all of must modules
  * have been installed. This function is called through delegates.
  * @var XoopsUser &$xoopsUser
  * @see preBlockFilter()
  */
 function callbackSetupUser(&$principal, &$controller, &$context)
 {
     $accessAllowFlag = false;
     $xoopsConfig = $controller->mRoot->mContext->getXoopsConfig();
     if (!empty($_POST['xoops_login'])) {
         $controller->checkLogin();
         return;
     } else {
         if (@$_GET['op'] == 'logout') {
             // GIJ
             $controller->logout();
             return;
         } elseif (is_object($context->mXoopsUser)) {
             foreach ($context->mXoopsUser->getGroups() as $group) {
                 if (in_array($group, $xoopsConfig['closesite_okgrp']) || XOOPS_GROUP_ADMIN == $group) {
                     $accessAllowFlag = true;
                     break;
                 }
             }
         }
     }
     if (!$accessAllowFlag) {
         require_once XOOPS_ROOT_PATH . '/class/template.php';
         $xoopsTpl = new XoopsTpl();
         $xoopsTpl->assign(array('xoops_sitename' => htmlspecialchars($xoopsConfig['sitename']), 'xoops_isuser' => is_object($context->mXoopsUser), 'xoops_themecss' => xoops_getcss(), 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/', 'lang_login' => _LOGIN, 'lang_username' => _USERNAME, 'lang_password' => _PASSWORD, 'lang_siteclosemsg' => $xoopsConfig['closesite_text']));
         $xoopsTpl->compile_check = true;
         // @todo filebase template with absolute file path
         $xoopsTpl->display(XOOPS_ROOT_PATH . '/modules/legacy/templates/legacy_site_closed.html');
         exit;
     }
 }
 function preBlockFilter()
 {
     if (LEGACY_INSTALLERCHECKER_ACTIVE == true && is_dir(XOOPS_ROOT_PATH . "/install")) {
         $root =& XCube_Root::getSingleton();
         $root->mLanguageManager->loadModuleMessageCatalog('legacy');
         $xoopsConfig = $root->mContext->mXoopsConfig;
         require_once XOOPS_ROOT_PATH . '/class/template.php';
         $xoopsTpl = new XoopsTpl();
         $xoopsTpl->assign(array('xoops_sitename' => htmlspecialchars($xoopsConfig['sitename']), 'xoops_themecss' => xoops_getcss(), 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/', 'lang_message_confirm' => XCube_Utils::formatMessage(_MD_LEGACY_MESSAGE_INSTALL_COMPLETE_CONFIRM, XOOPS_ROOT_PATH . "/install"), 'lang_message_warning' => XCube_Utils::formatMessage(_MD_LEGACY_MESSAGE_INSTALL_COMPLETE_WARNING, XOOPS_ROOT_PATH . "/install")));
         $xoopsTpl->compile_check = true;
         // @todo filebase template with absolute file path
         $xoopsTpl->display(XOOPS_ROOT_PATH . '/modules/legacy/templates/legacy_install_completed.html');
         exit;
     }
 }
function pico_xoopstpl($mydirname, $text, $content4assign)
{
    global $xoopsTpl;
    $tpl =& new XoopsTpl();
    //$tpl->plugins_dir[] = dirname(dirname(__FILE__)).'/smarty_plugins' ;
    array_unshift($tpl->plugins_dir, dirname(dirname(__FILE__)) . '/smarty_plugins');
    // pico plugin has the first priority
    if (is_object(@$xoopsTpl)) {
        $tpl->assign($xoopsTpl->get_template_vars());
        if (defined('XOOPS_CUBE_LEGACY')) {
            $root =& XCube_Root::getSingleton();
            $context =& $root->getContext();
            $themeName = $context->getThemeName();
            $tpl->assign('xoops_theme', $themeName);
            $tpl->assign('xoops_imageurl', XOOPS_THEME_URL . "/{$themeName}/");
            $tpl->assign('xoops_themecss', xoops_getcss($themeName));
        }
    }
    $tpl->assign('mydirname', $mydirname);
    $tpl->assign('mod_url', XOOPS_URL . '/modules/' . $mydirname);
    $tpl->assign('content', $content4assign);
    // assign special session
    $session_prefix = $mydirname . '_' . @$content4assign['id'] . '_';
    $session4assign = array();
    foreach (array_keys(@$_SESSION) as $index) {
        if (strncmp($index, $session_prefix, strlen($session_prefix)) === 0) {
            $session4assign[substr($index, strlen($session_prefix))] = $_SESSION[$index];
        }
    }
    $tpl->assign('session', $session4assign);
    $temp_file = XOOPS_COMPILE_PATH . '/' . substr(md5(XOOPS_DB_PREFIX . @$content4assign['id']), 16) . $mydirname . '_temp_resource';
    if (!$text || $text != @file_get_contents($temp_file)) {
        $fw = fopen($temp_file, 'wb');
        fwrite($fw, $text);
        fclose($fw);
        $tpl->clear_compiled_tpl('file:' . $temp_file);
    }
    $text = $tpl->fetch('file:' . $temp_file);
    //	unlink( $temp_file ) ;
    return $text;
}
Example #4
0
         echo $err;
     }
     echo '</code><br /><a href="admin.php?fct=tplsets">' . _MD_AM_BTOTADMIN . '</a>';
     xoops_cp_footer();
     break;
 case 'previewtpl':
     if (!$GLOBALS['xoopsSecurity']->check()) {
         redirect_header('admin.php?fct=tplsets', 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
     }
     require_once XOOPS_ROOT_PATH . '/class/template.php';
     $myts =& MyTextsanitizer::getInstance();
     $html = $myts->stripSlashesGPC($html);
     $tpltpl_handler =& xoops_gethandler('tplfile');
     $tplfile =& $tpltpl_handler->get($id, true);
     if (is_object($tplfile)) {
         $dummylayout = '<html><head><meta http-equiv="content-type" content="text/html; charset=' . _CHARSET . '" /><meta http-equiv="content-language" content="' . _LANGCODE . '" /><title>' . $xoopsConfig['sitename'] . '</title><style type="text/css" media="all" href="' . xoops_getcss() . '" />';
         $dummylayout .= '</head><body><{$content}></body></html>';
         if ($tplfile->getVar('tpl_type') == 'block') {
             $block_handler =& xoops_gethandler('block');
             $instance_handler =& xoops_gethandler('blockinstance');
             $instance =& $instance_handler->get($tplfile->getVar('tpl_refid'));
             $instance->setBlock($block_handler->get($instance->getVar('bid')));
             $xoopsTpl->assign('block', $instance->buildBlock());
         }
         $dummytpl = '_dummytpl_' . time() . '.html';
         $fp = fopen(XOOPS_CACHE_PATH . '/' . $dummytpl, 'w');
         fwrite($fp, $html);
         fclose($fp);
         $xoopsTpl->assign('content', $xoopsTpl->fetch('file:' . XOOPS_CACHE_PATH . '/' . $dummytpl));
         $xoopsTpl->clear_compiled_tpl('file:' . XOOPS_CACHE_PATH . '/' . $dummytpl);
         unlink(XOOPS_CACHE_PATH . '/' . $dummytpl);
Example #5
0
    }
    themeheader($xoopsOption['show_rblock']);
    if ($xoopsOption['show_cblock']) {
        make_cblock();
    }
    //create center block
} else {
    $xoopsOption['theme_use_smarty'] = 1;
    // include Smarty template engine and initialize it
    require_once XOOPS_ROOT_PATH . '/class/template.php';
    $xoopsTpl = new XoopsTpl();
    $xoopsTpl->xoops_setCaching(2);
    if ($xoopsConfig['debug_mode'] == 3) {
        $xoopsTpl->xoops_setDebugging(true);
    }
    $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($GLOBALS['xoopsRequestUri'], ENT_QUOTES), 'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES), 'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
    // Meta tags
    $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) {
        // prefix each tag with 'xoops_'
        $xoopsTpl->assign('xoops_' . $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
    }
    //unset($config);
    // show banner?
    if ($xoopsConfig['banners'] == 1) {
        $xoopsTpl->assign('xoops_banner', xoops_getbanner());
    } else {
        $xoopsTpl->assign('xoops_banner', '&nbsp;');
        //$row = mysql_fetch_object($result);
        if ($autostart == 1) {
            $autostart = 'true';
        } else {
            $autostart = 'false';
        }
        /* generate output */
        $player1 = str_replace('<@height@>', $height, $player);
        $player2 = str_replace('<@width@>', $width, $player1);
        $player3 = str_replace('<@autostart@>', $autostart, $player2);
    } else {
        $player3 .= preselected_player($fileid);
    }
} else {
    $player3 .= preselected_player($fileid);
}
$player4 = str_replace('<@mp3file@>', $mp3file, $player3);
$xoopsTpl->assign("player", $player4);
$allowyes = 1;
/* determine if downloads are allowed or if download is a link */
if ($xoopsModuleConfig['debaserallowdown'] == 1) {
    $xoopsTpl->assign("allowyes", $allowyes);
    if ($link != '') {
        $xoopsTpl->assign('linkyes', true);
        $xoopsTpl->assign('downlink', $link);
    }
}
$xoopsDB->queryF("\r\n\tUPDATE " . $xoopsDB->prefix('debaser_files') . " \r\n\tSET views = views+1 \r\n\tWHERE xfid = " . $songid . "");
$xoopsTpl->assign("maintheme", xoops_getcss($xoopsConfig['theme_set']));
$xoopsTpl->assign("xoops_url", XOOPS_URL);
$xoopsTpl->display('db:debaser_player.html');
 function draw_repost_form($area = '')
 {
     // Notify which file is broken
     if (headers_sent()) {
         restore_error_handler();
         set_error_handler('_XoopsNTicket_ErrorHandler4FindOutput');
         header('Dummy: for warning');
         restore_error_handler();
         exit;
     }
     error_reporting(0);
     while (ob_get_level()) {
         ob_end_clean();
     }
     global $xoopsTpl, $xoopsConfig, $xoopsOption, $xoopsLogger;
     if (file_exists(XOOPS_ROOT_PATH . '/themes/default/theme.html')) {
         $xoopsConfig['theme_set'] = 'default';
     }
     unset($xoopsOption['template_main']);
     $xoopsTpl =& new XoopsTpl();
     $xoopsOption['theme_use_smarty'] = 1;
     $xoopsConfig['debug_mode'] = 0;
     ob_start();
     $xoopsTpl->assign(array('xoops_theme' => $xoopsConfig['theme_set'], 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/', 'xoops_themecss' => xoops_getcss($xoopsConfig['theme_set']), 'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES), 'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
     $table = '<table class="outer">';
     $form = '<form action="?' . htmlspecialchars(@$_SERVER['QUERY_STRING'], ENT_QUOTES) . '" method="post" >';
     foreach ($_POST as $key => $val) {
         if ($key == $this->_post_param_name) {
             continue;
         }
         if (get_magic_quotes_gpc()) {
             $key = stripslashes($key);
         }
         if (is_array($val)) {
             list($tmp_table, $tmp_form) = $this->extract_post_recursive(htmlspecialchars($key, ENT_QUOTES), $val);
             $table .= $tmp_table;
             $form .= $tmp_form;
         } else {
             if (get_magic_quotes_gpc()) {
                 $val = stripslashes($val);
             }
             $table .= '<tr><th><code>' . htmlspecialchars($key, ENT_QUOTES) . '</code></th><td class="odd"><pre style="margin:0;padding:0;overflow:auto;"><code>' . htmlspecialchars($val, ENT_QUOTES) . '</code></pre></td></tr>' . "\n";
             $form .= '<input type="hidden" name="' . htmlspecialchars($key, ENT_QUOTES) . '" value="' . htmlspecialchars($val, ENT_QUOTES) . '" />' . "\n";
         }
     }
     $table .= '</table>';
     $form .= $this->getTicketHtml(__LINE__, 300, $area) . '<input type="submit" value="' . $this->messages['btn_repost'] . '" /></form>';
     //		echo '<html><head><title>'.$this->messages['err_general'].'</title><style>table,td,th {border:solid black 1px; border-collapse:collapse;}</style></head><body>' . sprintf( $this->messages['fmt_prompt4repost'] , $this->getErrors() ) . $table . $form . '</body></html>' ;
     echo sprintf($this->messages['fmt_prompt4repost'], $this->getErrors()) . $table . $form;
     include XOOPS_ROOT_PATH . '/footer.php';
 }
 /**
  * Checks whether the site is closed now, and whether all of must modules
  * have been installed. This function is called through delegates.
  * @var XoopsUser &$xoopsUser
  * @see preBlockFilter()
  */
 function callbackSetupUser(&$principal, &$controller, &$context)
 {
     $retArray = Legacy_Utils::checkSystemModules();
     $accessAllowFlag = false;
     $xoopsConfig = $controller->mRoot->mContext->getXoopsConfig();
     if (!empty($_POST['xoops_login'])) {
         define('XOOPS_CPFUNC_LOADED', 1);
         $controller->checkLogin();
         return;
     } elseif (is_object($context->mXoopsUser)) {
         if (in_array(XOOPS_GROUP_ADMIN, $context->mXoopsUser->getGroups())) {
             $accessAllowFlag = true;
         }
     }
     // @todo Devide following lines to another preload file
     if ($accessAllowFlag) {
         $GLOBALS['xoopsUser'] = $context->mXoopsUser;
         if (!empty($_POST['cube_module_install'])) {
             //@todo use Ticket
             require_once XOOPS_LEGACY_PATH . "/admin/class/ModuleInstaller.class.php";
             require_once XOOPS_LEGACY_PATH . "/admin/class/ModuleInstallUtils.class.php";
             if (isset($_POST['uninstalled_modules']) && is_array($_POST['uninstalled_modules'])) {
                 foreach ($_POST['uninstalled_modules'] as $module) {
                     $module = basename($module);
                     if (in_array($module, $retArray['uninstalled'])) {
                         $controller->mRoot->mLanguageManager->loadModuleAdminMessageCatalog('legacy');
                         $handler =& xoops_gethandler('module');
                         $xoopsModule =& $handler->create();
                         $xoopsModule->set('weight', 1);
                         $xoopsModule->loadInfoAsVar($module);
                         $installer =& Legacy_ModuleInstallUtils::createInstaller($xoopsModule->get('dirname'));
                         $installer->setForceMode(true);
                         $installer->setCurrentXoopsModule($xoopsModule);
                         $installer->executeInstall();
                     }
                 }
             }
             if (isset($_POST['disabled_modules']) && is_array($_POST['disabled_modules'])) {
                 $moduleHandler =& xoops_gethandler('module');
                 foreach ($_POST['disabled_modules'] as $module) {
                     $module = basename($module);
                     if (in_array($module, $retArray['disabled'])) {
                         if ($moduleObject =& $moduleHandler->getByDirname($module)) {
                             $moduleObject->setVar('isactive', 1);
                             $moduleHandler->insert($moduleObject);
                             $blockHandler =& xoops_gethandler('block');
                             $blockHandler->syncIsActive($moduleObject->get('mid'), $moduleObject->get('isactive'));
                         }
                     }
                 }
             }
             if (isset($_POST['option_modules']) && is_array($_POST['option_modules'])) {
                 $handler =& xoops_getmodulehandler('non_installation_module', 'legacy');
                 $objects = $handler->getObjects();
                 $optionModules = array();
                 foreach ($objects as $module) {
                     if (!in_array($module->get('dirname'), $retArray['uninstalled'])) {
                         $optionModules[] = $module->get('dirname');
                     }
                 }
                 foreach ($_POST['option_modules'] as $module) {
                     $module = basename($module);
                     if (in_array($module, $optionModules)) {
                         $controller->mRoot->mLanguageManager->loadModuleAdminMessageCatalog('legacy');
                         $handler =& xoops_gethandler('module');
                         $xoopsModule =& $handler->create();
                         $xoopsModule->set('weight', 1);
                         $xoopsModule->loadInfoAsVar($module);
                         $installer =& Legacy_ModuleInstallUtils::createInstaller($xoopsModule->get('dirname'));
                         $installer->setForceMode(true);
                         $installer->setCurrentXoopsModule($xoopsModule);
                         $installer->executeInstall();
                     }
                 }
             }
             $controller->executeRedirect(XOOPS_URL . '/', 1);
         } elseif (!empty($_GET['cube_module_uninstall'])) {
             require_once XOOPS_ROOT_PATH . '/class/template.php';
             $xoopsTpl = new XoopsTpl();
             $xoopsTpl->assign('cube_module_uninstall', htmlspecialchars($_GET['cube_module_uninstall'], ENT_QUOTES));
             $xoopsTpl->assign(array('xoops_sitename' => htmlspecialchars($xoopsConfig['sitename']), 'xoops_themecss' => xoops_getcss(), 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/'));
             ///< @todo filebase template with absolute file path
             $xoopsTpl->compile_check = true;
             $xoopsTpl->display(XOOPS_ROOT_PATH . '/modules/legacy/templates/legacy_uninstall_modules.html');
             exit;
         } elseif (!empty($_POST['cube_module_uninstallok'])) {
             //@todo use Ticket
             require_once XOOPS_LEGACY_PATH . "/admin/class/ModuleUninstaller.class.php";
             require_once XOOPS_LEGACY_PATH . "/admin/class/ModuleInstallUtils.class.php";
             $module = basename($_POST['cube_module_uninstallok']);
             if (in_array($module, $retArray['disabled'])) {
                 $controller->mRoot->mLanguageManager->loadModuleAdminMessageCatalog('legacy');
                 $handler =& xoops_gethandler('module');
                 $xoopsModule =& $handler->getByDirname($module);
                 $uninstaller =& Legacy_ModuleInstallUtils::createUninstaller($xoopsModule->get('dirname'));
                 $uninstaller->setForceMode(true);
                 $uninstaller->setCurrentXoopsModule($xoopsModule);
                 $uninstaller->executeUninstall();
             }
             $controller->executeRedirect(XOOPS_URL . '/', 1);
         } else {
             $handler =& xoops_getmodulehandler('non_installation_module', 'legacy');
             $objects = $handler->getObjectsFor2ndInstaller();
             $optionModules = array();
             foreach ($objects as $module) {
                 $dirname = $module->getVar('dirname');
                 if (!in_array($dirname, $retArray['uninstalled'])) {
                     $optionModule['dirname'] = $dirname;
                     if (in_array($dirname, $retArray['recommended'])) {
                         $optionModule['checked'] = 'checked="checked"';
                         $optionModule['desc'] = _SYS_RECOMMENDED_MODULES;
                         $optionModules[' ' . $dirname] = $optionModule;
                     } else {
                         $optionModule['checked'] = '';
                         $optionModule['desc'] = _SYS_OPTION_MODULES;
                         $optionModules[$dirname] = $optionModule;
                     }
                 }
             }
             ksort($optionModules);
             $optionModules = array_values($optionModules);
             require_once XOOPS_ROOT_PATH . '/class/template.php';
             $xoopsTpl = new XoopsTpl();
             $xoopsTpl->assign('uninstalled', $retArray['uninstalled']);
             $xoopsTpl->assign('disabled', $retArray['disabled']);
             $xoopsTpl->assign('option', $optionModules);
             $xoopsTpl->assign(array('xoops_sitename' => htmlspecialchars($xoopsConfig['sitename']), 'xoops_themecss' => xoops_getcss(), 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/'));
             ///< @todo filebase template with absolute file path
             $xoopsTpl->compile_check = true;
             $xoopsTpl->display(XOOPS_ROOT_PATH . '/modules/legacy/templates/legacy_install_modules.html');
             exit;
         }
     }
     if (!$accessAllowFlag) {
         require_once XOOPS_ROOT_PATH . '/class/template.php';
         $xoopsTpl = new XoopsTpl();
         $xoopsTpl->assign(array('xoops_sitename' => htmlspecialchars($xoopsConfig['sitename']), 'xoops_themecss' => xoops_getcss(), 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/', 'lang_login' => _LOGIN, 'lang_username' => _USERNAME, 'lang_password' => _PASSWORD, 'lang_siteclosemsg' => $xoopsConfig['closesite_text']));
         $xoopsTpl->compile_check = true;
         // @todo filebase template with absolute file path
         $xoopsTpl->display(XOOPS_ROOT_PATH . '/modules/legacy/templates/legacy_site_closed.html');
         exit;
     }
 }
Example #9
0
$username = isset($_POST['username']) ? trim($_POST['username']) : '';
$password = isset($_POST['userpass']) ? trim($_POST['userpass']) : '';
if ($username == '' || $password == '') {
    $op = 'login';
}
echo '
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=' . _CHARSET . '" />
    <meta http-equiv="content-language" content="' . _LANGCODE . '" />
    <title>' . $xoopsConfig['sitename'] . '</title>
    <link rel="stylesheet" type="text/css" media="all" href="' . XOOPS_URL . '/xoops.css" />
';
$style = getcss($xoopsConfig['theme_set']);
if ($style == '') {
    $style = xoops_getcss($xoopsConfig['theme_set']);
}
if ($style != '') {
    echo '<link rel="stylesheet" type="text/css" media="all" href="' . $style . '" />';
}
echo '
  </head>
  <body>
';
if ($op == 'dologin') {
    $member_handler =& xoops_gethandler('member');
    $myts =& MyTextsanitizer::getInstance();
    $user =& $member_handler->loginUser(addslashes($myts->stripSlashesGPC($username)), addslashes($myts->stripSlashesGPC($password)));
    if (is_object($user)) {
        if (0 == $user->getVar('level')) {
            redirect_header(XOOPS_URL . '/index.php', 5, _US_NOACTTPADM);
Example #10
0
 /**
  * Returns javascript for the SQL debug window
  *
  * @return string
  **/
 function getSQLDebug()
 {
     global $xoopsConfig;
     $ret = '<script type="text/javascript">
     		<!--//
     		debug_window = openWithSelfMain("", "popup", 680, 450, true);
     		debug_window.document.clear();
     		';
     $content = '<html><head>
                 <meta http-equiv="content-type" content="text/html; charset=' . _CHARSET . '" />
                 <meta http-equiv="content-language" content="' . _LANGCODE . '" />
                 <title>' . $xoopsConfig['sitename'] . '</title>
                 <link rel="stylesheet" type="text/css" media="all" href="' . xoops_getcss($xoopsConfig['theme_set']) . '" />
                 </head>
                 <body>' . $this->dumpAll() . '
                 <div style="text-align:center;">
                 <input class="formButton" value="' . _CLOSE . '" type="button" onclick="javascript:window.close();" />
                 </div>
                 </body>
                 </html>';
     $lines = preg_split("/(\r\n|\r|\n)( *)/", $content);
     foreach ($lines as $line) {
         $ret .= 'debug_window.document.writeln("' . str_replace('"', '\\"', $line) . '");';
     }
     //$ret .= 'debug_window.focus();';
     $ret .= 'debug_window.document.close();
             window.focus();
     		//-->
     		</script>';
     return $ret;
 }
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <http://www.xoops.org/>                             //
// ------------------------------------------------------------------------- //
//  This program 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.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
include '../../mainfile.php';
require_once XOOPS_ROOT_PATH . '/class/template.php';
$xoopsTpl = new XoopsTpl();
$xfid = $xoopsDB->getInsertId();
$sql = "\r\n\tSELECT title, artist, album, year, addinfo, track, genre, length, bitrate, frequence, approved\r\n\tFROM " . $xoopsDB->prefix('debaser_files') . "\r\n\tORDER BY xfid DESC";
$result = $xoopsDB->query($sql);
list($title, $artist, $album, $year, $addinfo, $track, $genre, $length, $bitrate, $frequence, $approved) = $xoopsDB->fetchRow($result);
$xoopsTpl->assign(array('title' => $title, 'artist' => $artist, 'album' => $album, 'year' => $year, 'addinfo' => $addinfo, 'track' => $track, 'genre' => $genre, 'length' => $length, 'bitrate' => $bitrate, 'frequence' => $frequence, 'approved' => $approved, 'maintheme' => xoops_getcss($xoopsConfig['theme_set'])));
$xoopsTpl->display('db:debaser_uploadresult.html');
Example #12
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 .= '&amp;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 .= '&amp;' . SID;
        }
    }
    $url = preg_replace("/&amp;/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;
}
 /**
  * @protected
  * Assign common variables for the compatibility with X2.
  */
 function _commonPrepareRender()
 {
     $root =& $this->mController->mRoot;
     $context =& $root->getContext();
     $textFilter =& $root->getTextFilter();
     $themeName = $context->getThemeName();
     $vars = array('xoops_theme' => $themeName, 'xoops_imageurl' => XOOPS_THEME_URL . "/{$themeName}/", 'xoops_themecss' => xoops_getcss($themeName), 'xoops_sitename' => $textFilter->toShow($context->getAttribute('legacy_sitename')), 'xoops_pagetitle' => $textFilter->toShow($context->getAttribute('legacy_pagetitle')), 'xoops_slogan' => $textFilter->toShow($context->getAttribute('legacy_slogan')));
     //
     // Assign module informations.
     //
     if ($context->mModule != null) {
         // The process of module
         $xoopsModule =& $context->mXoopsModule;
         $vars['xoops_modulename'] = $xoopsModule->getVar('name');
         $vars['xoops_dirname'] = $xoopsModule->getVar('dirname');
     }
     if (isset($GLOBALS['xoopsUserIsAdmin'])) {
         $vars['xoops_isadmin'] = $GLOBALS['xoopsUserIsAdmin'];
     }
     $this->mXoopsTpl->assign($vars);
 }
Example #14
0
 /**
  * Initializes this theme
  *
  * Upon initialization, the theme creates its template engine and instantiates the
  * plug-ins from the specified {@link $plugins} list. If the theme is a 2.0 theme, that does not
  * display redirection messages, the HTTP redirections system is disabled to ensure users will
  * see the redirection screen.
  *
  * @param  array $options
  * @return bool
  */
 public function xoInit($options = array())
 {
     /** @var XoopsConfigHandler $configHandler */
     $configHandler = xoops_getHandler('config');
     $this->path = XOOPS_THEME_PATH . '/' . $this->folderName;
     $this->url = XOOPS_THEME_URL . '/' . $this->folderName;
     $this->template = null;
     $this->template = new XoopsTpl();
     $this->template->currentTheme = $this;
     $this->template->assign_by_ref('xoTheme', $this);
     $xoops_page = str_replace(realpath(XOOPS_ROOT_PATH) . '/', '', realpath($_SERVER['SCRIPT_FILENAME']));
     if (strpos($xoops_page, 'modules') !== false) {
         $xoops_page = str_replace('modules/', '', $xoops_page);
     }
     $xoops_page = str_replace('.php', '', $xoops_page);
     if (isset($GLOBALS['xoopsConfig']['startpage'])) {
         $xoops_startpage = $GLOBALS['xoopsConfig']['startpage'];
         if ($xoops_startpage == '--') {
             $xoops_startpage = 'system';
         }
     } else {
         $xoops_startpage = 'system';
     }
     $searchConfig = $configHandler->getConfigsByCat(XOOPS_CONF_SEARCH);
     $xoops_search = (bool) (isset($searchConfig['enable_search']) && $searchConfig['enable_search'] === 1);
     $this->template->assign(array('xoops_theme' => $GLOBALS['xoopsConfig']['theme_set'], 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $GLOBALS['xoopsConfig']['theme_set'] . '/', 'xoops_themecss' => xoops_getcss($GLOBALS['xoopsConfig']['theme_set']), 'xoops_requesturi' => htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES), 'xoops_sitename' => htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES), 'xoops_slogan' => htmlspecialchars($GLOBALS['xoopsConfig']['slogan'], ENT_QUOTES), 'xoops_dirname' => isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('dirname') : 'system', 'xoops_page' => $xoops_page, 'xoops_startpage' => $xoops_startpage, 'xoops_banner' => $GLOBALS['xoopsConfig']['banners'] && $this->renderBanner ? xoops_getbanner() : '&nbsp;', 'xoops_pagetitle' => isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('name') : htmlspecialchars($GLOBALS['xoopsConfig']['slogan'], ENT_QUOTES), 'xoops_search' => $xoops_search));
     if (isset($GLOBALS['xoopsUser']) && is_object($GLOBALS['xoopsUser'])) {
         $this->template->assign(array('xoops_isuser' => true, 'xoops_avatar' => XOOPS_UPLOAD_URL . '/' . $GLOBALS['xoopsUser']->getVar('user_avatar'), 'xoops_userid' => $GLOBALS['xoopsUser']->getVar('uid'), 'xoops_uname' => $GLOBALS['xoopsUser']->getVar('uname'), 'xoops_name' => $GLOBALS['xoopsUser']->getVar('name'), 'xoops_isadmin' => $GLOBALS['xoopsUserIsAdmin'], 'xoops_usergroups' => $GLOBALS['xoopsUser']->getGroups()));
     } else {
         $this->template->assign(array('xoops_isuser' => false, 'xoops_isadmin' => false, 'xoops_usergroups' => array(XOOPS_GROUP_ANONYMOUS)));
     }
     // Meta tags
     $criteria = new CriteriaCompo(new Criteria('conf_modid', 0));
     $criteria->add(new Criteria('conf_catid', XOOPS_CONF_METAFOOTER));
     $config = $configHandler->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_') {
             $this->addMeta('meta', substr($name, 5), $value);
         } else {
             // prefix each tag with 'xoops_'
             $this->template->assign("xoops_{$name}", $value);
         }
     }
     // Load global javascript
     $this->addScript('include/xoops.js');
     $this->loadLocalization();
     if ($this->bufferOutput) {
         ob_start();
     }
     $GLOBALS['xoTheme'] =& $this;
     $GLOBALS['xoopsTpl'] =& $this->template;
     // Instanciate and initialize all the theme plugins
     foreach ($this->plugins as $k => $bundleId) {
         if (!is_object($bundleId)) {
             $this->plugins[$bundleId] = null;
             $this->plugins[$bundleId] = new $bundleId();
             $this->plugins[$bundleId]->theme =& $this;
             $this->plugins[$bundleId]->xoInit();
             unset($this->plugins[$k]);
         }
     }
     return true;
 }
Example #15
0
if ( empty( $template ) ) {
	readfile( $file_path ) ;
	exit ;
}

$theme = $xoopsConfig['theme_set'] ;

// UA
if( stristr( $_SERVER['HTTP_USER_AGENT'] , 'Opera' ) ) {
	$ua_type = 'Opera' ;
} else if( stristr( $_SERVER['HTTP_USER_AGENT'] , 'MSIE' ) ) {
	$ua_type = 'IE' ;
} else {
	$ua_type = 'NN' ;
}

require_once XOOPS_ROOT_PATH.'/class/template.php' ;
$tpl = new XoopsTpl() ;
$tpl->assign( array(
	'mydirname'      => $mydirname ,
	'mod_url'        => XOOPS_URL.'/modules/'.$mydirname ,
	'xoops_config'   => $xoopsConfig ,
	'xoops_theme'    => $theme ,
	'xoops_imageurl' => XOOPS_THEME_URL.'/'.$theme.'/' ,
	'xoops_themecss' => xoops_getcss($theme) ,
	'ua_type'        => $ua_type ,
) ) ;
if ( ! empty( $template ) ) $tpl->display( 'db:'.$template ) ;
exit ;

?>
Example #16
0
 function loadCss($css_file = 'style.css')
 {
     static $css_url, $css_path;
     if (!isset($css_url)) {
         $css_url = dirname(xoops_getcss($GLOBALS['xoopsConfig']['theme_set']));
         $css_path = str_replace(XOOPS_THEME_URL, XOOPS_THEME_PATH, $css_url);
     }
     $css = array();
     $css[] = $css_url . '/' . $css_file;
     $css_content = file_get_contents($css_path . '/' . $css_file);
     // get all import css files
     if (preg_match_all("~\\@import url\\((.*\\.css)\\);~sUi", $css_content, $matches, PREG_PATTERN_ORDER)) {
         foreach ($matches[1] as $key => $css_import) {
             $css = array_merge($css, $this->loadCss($css_import));
         }
     }
     return $css;
 }
Example #17
0
    $criteria->setLimit($limit);
    $products = array();
    $products = $oledrion_handlers->h_oledrion_products->getObjects($criteria);
    $javascriptSearch = array("'", '"');
    $javascriptReplace = array(' ', ' ');
    if (count($products) > 0) {
        foreach ($products as $product) {
            $productData = $product->toArray();
            $productData['product_title_javascript'] = str_replace($javascriptSearch, $javascriptReplace, $product->getVar('product_title', 'n'));
            //$productData['product_title_javascript'] = $product->getVar('product_title', 'n');
            $xoopsTpl->append('products', $productData);
        }
    }
}
oledrion_utils::loadLanguageFile('modinfo.php');
oledrion_utils::loadLanguageFile('main.php');
$categoriesSelect = $mytree->makeSelBox('product_cid', 'cat_title', '-', $selectedCategory, '---', 0, "class='selectLists'");
$xoopsTpl->assign('callerName', $callerName);
$xoopsTpl->assign('sart', $start);
$xoopsTpl->assign('theme_set', xoops_getcss($xoopsConfig['theme_set']));
$xoopsTpl->assign('xoopsConfig', $xoopsConfig);
$xoopsTpl->assign('mutipleSelect', $mutipleSelect);
$xoopsTpl->assign('searchVendorSelected', $searchVendorSelected);
$xoopsTpl->assign('baseurl', OLEDRION_URL . 'admin/' . basename(__FILE__));
// URL de ce script
$xoopsTpl->assign('searchVendor', $vendors);
$xoopsTpl->assign('searchCriteria', $searchCriterias);
$xoopsTpl->assign('searchField', $searchFields);
$xoopsTpl->assign('searchCategory', $categoriesSelect);
$xoopsTpl->assign('searchFieldSelected', $selectedSearchField);
echo $xoopsTpl->fetch('db:oledrion_productsselector.html');
Example #18
0
		$html = icms_core_DataFilter::stripSlashesGPC($html);
		$tpltpl_handler =& icms::handler('icms_view_template_file');
		$tplfile =& $tpltpl_handler->get($id, TRUE);
		$xoopsTpl = new icms_view_Tpl();

		if (is_object($tplfile)) {
			$dummylayout = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
			. '<html><head><meta http-equiv="content-type" content="text/html; charset=' . _CHARSET 
			. '" /><meta http-equiv="content-language" content="' . _LANGCODE 
			. '" /><title>' . $icmsConfig['sitename'] . '</title>'
			. '<link rel="stylesheet" type="text/css" media="screen" href="' . ICMS_URL . '/icms' 
				. (( defined('_ADM_USE_RTL') && _ADM_USE_RTL ) 
					? '_rtl'
					:'') 
				. '.css" /><link rel="stylesheet" type="text/css" media="screen" href="' 
				. xoops_getcss($icmsConfig['theme_set']) . '" />';

			$css =& $tpltpl_handler->find($icmsConfig['template_set'], 'css', 0, NULL, NULL, TRUE);
			$csscount = count($css);

			for ($i = 0; $i < $csscount; $i++) {
				$dummylayout .= "\n" . $css[$i]->getVar('tpl_source');
			}

			$dummylayout .= "\n" . '</style></head><body><div id="xo-canvas"><{$content}></div></body></html>';
			if ($tplfile->getVar('tpl_type') == 'block') {

				$block = new icms_view_block_Object($tplfile->getVar('tpl_refid'));
				$xoopsTpl->assign('block', $block->buildBlock());
			}
function getcss($theme = '')
{
    $GLOBALS['xoopsLogger']->addDeprecated("Function " . __FUNCTION__ . "() is deprecated, use xoops_getcss instead");
    return xoops_getcss($theme);
}
    }
    // Delete file - end
    // ************************* NOT USED ************************************
}
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . _LANGCODE . '" lang="' . _LANGCODE . '">';
echo '<head>';
echo '<meta http-equiv="content-type" content="text/html; charset=' . _CHARSET . '" />';
echo '<meta http-equiv="content-language" content="' . _LANGCODE . '" />';
echo '<title>{#xoopsimagebrowser_dlg.dialog_title}</title>';
echo '<script type="text/javascript" src="../../tiny_mce_popup.js"></script>';
echo '<script type="text/javascript" src="../../utils/mctabs.js"></script>';
echo '<script type="text/javascript" src="../../utils/form_utils.js"></script>';
echo '<script type="text/javascript" src="../../utils/validate.js"></script>';
echo '<script type="text/javascript" src="js/xoopsimagebrowser.js"></script>';
echo '<link href="' . xoops_getcss($xoopsConfig['theme_set']) . '" rel="stylesheet" type="text/css" />';
echo '<link href="css/xoopsimagebrowser.css" rel="stylesheet" type="text/css" />';
echo '<base target="_self" />';
echo '</head>';
echo '<body>';
echo '<div class="tabs">';
echo '<ul>';
echo '<li id="imagebrowser_tab" class="current"><span><a href="javascript:mcTabs.displayTab(\'imagebrowser_tab\',\'imagebrowser_panel\');" onmousedown="return false;">';
if ($op == 'listimg') {
    echo '{#xoopsimagebrowser_dlg.tab_listimages}';
} else {
    echo '{#xoopsimagebrowser_dlg.tab_listcategories}';
}
echo '</a></span></li>';
if (!empty($catwritelist)) {
    echo '<li id="loadimage_tab"><span><a href="javascript:mcTabs.displayTab(\'loadimage_tab\',\'loadimage_panel\');" onmousedown="return false;">{#xoopsimagebrowser_dlg.tab_loadimage}</a></span></li>';
Example #21
0
                    $options2[$values['ele_id']] = "Group by: " . printSmart(trans($values['ele_colhead']));
                } else {
                    $options2[$values['ele_id']] = "Group by: " . printSmart(trans(strip_tags($values['ele_caption'])));
                }
            }
        }
    }
}
include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
print "<HTML>";
print "<head>";
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . _CHARSET . "\" />";
print "<title>" . _formulize_DE_PICKCALCS . "</title>\n";
calcJavascript();
print "<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"" . XOOPS_URL . "/xoops.css\" />\n";
$themecss = xoops_getcss();
//$themecss = substr($themecss, 0, -6);
//$themecss .= ".css";
print "<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"{$themecss}\" />\n";
print "</head>";
print "<body style=\"background: white; margin-top:20px;\"><center>";
print "<table width=100%><tr><td width=5%></td><td width=90%>";
$pickcalc = new xoopsThemeForm(_formulize_DE_PICKCALCS, 'pickcalc', $_SERVER["REQUEST_URI"]);
$returned = addReqdCalcs($pickcalc);
$pickcalc = $returned['form'];
// add note for module admins to remind them of the need to set types properly for some calculations to work
if ($xoopsUser) {
    if ($gperm_handler->checkRight("module_admin", getFormulizeModId(), $xoopsUser->getGroups(), 1)) {
        $pickcalc->insertBreak("<div style=\"font-weight: normal;\">" . _formulize_DE_CALC_NEEDDATATYPES1 . "<a href=\"" . XOOPS_URL . "/modules/formulize/admin/index.php?title={$fid}\" target=\"_blank\">" . _formulize_DE_CALC_NEEDDATATYPES2 . "</a></div>", "head");
        // add note for module admins to remind them to set types properly for calculations to work
    }
Example #22
0
function getcss($theme = '')
{
    return xoops_getcss($theme);
}
Example #23
0
/**
 * Function to get css file for a certain theme
 * @deprecated use xoops_getcss() instead
 * @todo Remove in version 1.4 - all instances have been removed from the core
 */
function getcss($theme = '')
{
    icms_core_Debug::setDeprecated('xoops_getcss');
    return xoops_getcss($theme);
}
    $GLOBALS['blog_ID'] = 1;
}
if (!isset($debug)) {
    $GLOBALS['debug'] = 0;
}
timer_start();
get_currentuserinfo();
$GLOBALS['posts_per_page'] = get_settings('posts_per_page');
$GLOBALS['what_to_show'] = get_settings('what_to_show');
$GLOBALS['archive_mode'] = get_settings('archive_mode');
$GLOBALS['time_difference'] = get_settings('time_difference');
$GLOBALS['date_format'] = stripslashes(get_settings('date_format'));
$GLOBALS['time_format'] = stripslashes(get_settings('time_format'));
$GLOBALS['admin_area_charset'] = $blog_charset;
$_css_file = get_custom_url('wp-admin.css');
$_xoops_css = xoops_getcss($xoopsConfig['theme_set']);
$_module_title = get_bloginfo('name') . " : " . $title;
if ($GLOBALS['standalone'] == 0 && get_param('profile') == 0) {
    $GLOBALS['xoopsTpl']->assign('xoops_module_header', '<link rel="stylesheet" href="' . $_css_file . '" type="text/css" />');
    $GLOBALS['xoopsTpl']->assign('xoops_pagetitle', $_module_title);
} else {
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WordPress : <?php 
    echo $_module_title;
    ?>
</title>
<link rel="stylesheet" href="<?php 
    echo $_xoops_css;
Example #25
0
//xoops_header(false);
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . _LANGCODE . '" lang="' . _LANGCODE . '">';
echo '<head>';
echo '<meta http-equiv="content-type" content="text/html; charset=' . _CHARSET . '" />';
echo '<meta http-equiv="content-language" content="' . _LANGCODE . '" />';
?>
<head>
    <title>{#xoopsemotions_dlg.title}</title>
    <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
    <script type="text/javascript" src="../../utils/mctabs.js"></script>
    <script type="text/javascript" src="../../utils/form_utils.js"></script>
    <script type="text/javascript" src="../../utils/validate.js"></script>
    <script type="text/javascript" src="js/xoopsemotions.js"></script>
    <link href="<?php 
echo xoops_getcss($xoopsConfig['theme_set']);
?>
" rel="stylesheet" type="text/css" />
    <link href="css/xoopsemotions.css" rel="stylesheet" type="text/css" />
    <base target="_self" />
</head>
<body>

<?php 
if (!$_SESSION['XoopsEmotions'] && !$admin) {
    echo "<div class='xoopsEmotions'>";
    echo "<div>{#xoopsemotions_dlg.error_noemotions}</div>";
    echo "</div>";
    echo "<div class='mceActionPanel floatright'>";
    echo "<input type='button' id='cancel' name='cancel' value='{#cancel}' onclick='tinyMCEPopup.close();' />";
    echo "</div>";
Example #26
0
 * @author              Taiwen Jiang <*****@*****.**>
 *
 * @todo                Not well written, just keep as it is. Refactored in 3.0
 */
defined('XOOPS_ROOT_PATH') || exit('Restricted access');
$ret = '';
if ($mode === 'popup') {
    $dump = $this->dump('');
    $content = '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
    <meta http-equiv="content-language" content="' . _LANGCODE . '" />
    <meta http-equiv="content-type" content="text/html; charset=' . _CHARSET . '" />
    <title>' . $xoopsConfig['sitename'] . ' - ' . _LOGGER_DEBUG . ' </title>
    <meta name="generator" content="XOOPS" />
    <link rel="stylesheet" type="text/css" media="all" href="' . xoops_getcss($xoopsConfig['theme_set']) . '" />
</head>
<body>' . $dump . '
    <div style="text-align:center;">
        <input class="formButton" value="' . _CLOSE . '" type="button" onclick="window.close();" />
    </div>
';
    $ret .= '
<script type="text/javascript">
    debug_window = openWithSelfMain("about:blank", "popup", 680, 450, true);
    debug_window.document.clear();
';
    $lines = preg_split("/(\r\n|\r|\n)( *)/", $content);
    foreach ($lines as $line) {
        $ret .= "\n" . 'debug_window.document.writeln("' . str_replace(array('"', '</'), array('\\"', '<\\/'), $line) . '");';
    }
Example #27
0
    }
} 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() : '&nbsp;', '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);
        }
    }
    $xoopsTpl->debugging = false;
Example #28
0
     $allowed = false;
     if (is_object($xoopsUser)) {
         foreach ($xoopsUser->getGroups() as $group) {
             if (in_array($group, $xoopsConfig['closesite_okgrp']) || XOOPS_GROUP_ADMIN == $group) {
                 $allowed = true;
                 break;
             }
         }
     } elseif (!empty($_POST['xoops_login'])) {
         include_once XOOPS_ROOT_PATH . '/include/checklogin.php';
         exit;
     }
     if (!$allowed) {
         include_once XOOPS_ROOT_PATH . '/class/template.php';
         $xoopsTpl = new XoopsTpl();
         $xoopsTpl->assign(array('xoops_sitename' => htmlspecialchars($xoopsConfig['sitename']), 'xoops_themecss' => xoops_getcss(), 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/', 'lang_login' => _LOGIN, 'lang_username' => _USERNAME, 'lang_password' => _PASSWORD, 'lang_siteclosemsg' => $xoopsConfig['closesite_text']));
         $xoopsTpl->xoops_setCaching(1);
         $xoopsTpl->display('db:system_siteclosed.html');
         exit;
     }
     unset($allowed, $group);
 }
 if (file_exists('./xoops_version.php')) {
     $url_arr = explode('/', strstr($xoopsRequestUri, '/modules/'));
     $module_handler =& xoops_gethandler('module');
     $xoopsModule =& $module_handler->getByDirname($url_arr[2]);
     unset($url_arr);
     if (!$xoopsModule || !$xoopsModule->getVar('isactive')) {
         include_once XOOPS_ROOT_PATH . "/header.php";
         echo "<h4>" . _MODULENOEXIST . "</h4>";
         include_once XOOPS_ROOT_PATH . "/footer.php";
Example #29
0
<?php

// send header
if (!headers_sent()) {
    $cache_limit = 3600;
    session_cache_limiter('public');
    header("Expires: " . date('r', intval(time() / $cache_limit) * $cache_limit + $cache_limit));
    header("Cache-Control: public, max-age={$cache_limit}");
    header("Last-Modified: " . date('r', intval(time() / $cache_limit) * $cache_limit));
    header('Content-Type: text/css');
}
if (is_object($xoopsUser)) {
    $xoops_isuser = true;
    $xoops_userid = $xoopsUser->getVar('uid');
    $xoops_uname = $xoopsUser->getVar('uname');
    $xoops_isadmin = $xoopsUserIsAdmin;
} else {
    $xoops_isuser = false;
    $xoops_userid = 0;
    $xoops_uname = '';
    $xoops_isadmin = false;
}
require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
$tpl = new D3Tpl();
$tpl->assign(array('mydirname' => $mydirname, 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'xoops_config' => $xoopsConfig, 'mod_config' => $xoopsModuleConfig, 'xoops_theme' => $xoopsConfig['theme_set'], 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/', 'xoops_themecss' => xoops_getcss($xoopsConfig['theme_set']), 'xoops_isuser' => $xoops_isuser, 'xoops_userid' => $xoops_userid, 'xoops_uname' => $xoops_uname, 'xoops_isadmin' => $xoops_isadmin));
$tpl->display('db:' . $mydirname . '_main.css');
exit;
Example #30
0
function testMailbox()
{
    $hDeptServers =& xhelpGetHandler('departmentMailBox');
    $server = $hDeptServers->create();
    $server->setVar('emailaddress', $_POST['emailaddress']);
    $server->setVar('server', $_POST['server']);
    $server->setVar('serverport', $_POST['port']);
    $server->setVar('username', $_POST['username']);
    $server->setVar('password', $_POST['password']);
    $server->setVar('priority', $_POST['priority']);
    echo "<html>";
    echo "<head>";
    echo "<link rel='stylesheet' type='text/css' media'screen' href='" . XOOPS_URL . "/xoops.css' />\r\n          <link rel='stylesheet' type='text/css' media='screen' href='" . xoops_getcss() . "' />\r\n          <link rel='stylesheet' type='text/css' media='screen' href='" . XOOPS_URL . "/modules/system/style.css' />";
    echo "</head>";
    echo "<body>";
    echo "<table style='margin:0; padding:0;' class='outer'>";
    if (@$server->connect()) {
        //Connection Succeeded
        echo "<tr><td class='head'>Connection Successful!</td></tr>";
    } else {
        //Connection Failed
        echo "<tr class='head'><td>Connection Failed!</td></tr>";
        echo "<tr class='even'><td>" . $server->getHtmlErrors() . "</td></tr>";
    }
    echo "</table>";
    echo "</body>";
    echo "</html>";
}