Esempio n. 1
0
 /**
  * Constructor
  *
  * @param    string    $caption
  * @param    string    $name
  * @param    mixed    $value            Pre-selected value (or array of them).
  *                                    For an item with massive members, such as "Registered Users", "$value" should be used to store selected temporary users only instead of all members of that item
  * @param    bool    $include_anon    Include user "anonymous"?
  * @param    int        $size            Number or rows. "1" makes a drop-down-list.
  * @param    bool    $multiple       Allow multiple selections?
  */
 function __construct($caption, $name, $include_anon = false, $value = null, $size = 1, $multiple = false)
 {
     $limit = 200;
     $select_element = new Xmf_Form_Element_Select("", $name, $value, $size, $multiple);
     if ($include_anon) {
         $select_element->addOption(0, $GLOBALS["xoopsConfig"]['anonymous']);
     }
     $member_handler =& xoops_gethandler('member');
     $user_count = $member_handler->getUserCount();
     $value = is_array($value) ? $value : (empty($value) ? array() : array($value));
     if ($user_count > $limit && count($value) > 0) {
         $criteria = new CriteriaCompo(new Criteria("uid", "(" . implode(",", $value) . ")", "IN"));
     } else {
         $criteria = new CriteriaCompo();
         $criteria->setLimit($limit);
     }
     $criteria->setSort('uname');
     $criteria->setOrder('ASC');
     $users = $member_handler->getUserList($criteria);
     $select_element->addOptionArray($users);
     if ($user_count <= $limit) {
         parent::__construct($caption, "", $name);
         $this->addElement($select_element);
         return;
     }
     xoops_loadLanguage("findusers");
     $js_addusers = "<script type=\"text/javascript\">\r\n            function addusers(opts){\r\n                var num = opts.substring(0, opts.indexOf(\":\"));\r\n                opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                var sel = xoopsGetElementById(\"" . $name . ($multiple ? "[]" : "") . "\");\r\n                var arr = new Array(num);\r\n                for (var n=0; n < num; n++) {\r\n                    var nm = opts.substring(0, opts.indexOf(\":\"));\r\n                    opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                    var val = opts.substring(0, opts.indexOf(\":\"));\r\n                    opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                    var txt = opts.substring(0, nm - val.length);\r\n                    opts = opts.substring(nm - val.length, opts.length);\r\n                    var added = false;\r\n                    for (var k = 0; k < sel.options.length; k++) {\r\n                        if(sel.options[k].value == val){\r\n                            added = true;\r\n                            break;\r\n                        }\r\n                    }\r\n                    if (added == false) {\r\n                        sel.options[k] = new Option(txt, val);\r\n                        sel.options[k].selected = true;\r\n                    }\r\n                }\r\n                return true;\r\n            }\r\n            </script>";
     $token = $GLOBALS['xoopsSecurity']->createToken();
     $action_tray = new Xmf_Form_Element_Tray("", " | ");
     $action_tray->addElement(new Xmf_Form_Element_Label('', "<a href='#' onclick='var sel = xoopsGetElementById(\"" . $name . ($multiple ? "[]" : "") . "\");for (var i = sel.options.length-1; i >= 0; i--) {if (!sel.options[i].selected) {sel.options[i] = null;}}; return false;'>" . _MA_USER_REMOVE . "</a>"));
     $action_tray->addElement(new Xmf_Form_Element_Label('', "<a href='#' onclick='openWithSelfMain(\"" . XOOPS_URL . "/include/findusers.php?target={$name}&amp;multiple={$multiple}&amp;token={$token}\", \"userselect\", 800, 600, null); return false;' >" . _MA_USER_MORE . "</a>" . $js_addusers));
     parent::__construct($caption, "<br /><br />", $name);
     $this->addElement($select_element);
     $this->addElement($action_tray);
 }
Esempio n. 2
0
 /**
  * Prepare HTML for output
  *
  * @return    string  HTML
  */
 function render()
 {
     static $js_loaded;
     xoops_loadLanguage("formdhtmltextarea");
     $ret = "";
     // actions
     $ret .= $this->codeIcon() . "<br />\n";
     // fonts
     $ret .= $this->fontArray();
     // length checker
     $ret .= "<input type='button' onclick=\"XoopsCheckLength('" . $this->getName() . "', '" . @$this->configs['maxlength'] . "', '" . _XOOPS_FORM_ALT_LENGTH . "', '" . _XOOPS_FORM_ALT_LENGTH_MAX . "');\" value=' ? ' title='" . _XOOPS_FORM_ALT_CHECKLENGTH . "' />";
     $ret .= "<br />\n";
     // the textarea box
     $ret .= "<textarea id='" . $this->getName() . "' name='" . $this->getName() . "' onselect=\"xoopsSavePosition('" . $this->getName() . "');\" onclick=\"xoopsSavePosition('" . $this->getName() . "');\" onkeyup=\"xoopsSavePosition('" . $this->getName() . "');\" cols='" . $this->getCols() . "' rows='" . $this->getRows() . "'" . $this->getExtra() . ">" . $this->getValue() . "</textarea><br />\n";
     if (empty($this->skipPreview)) {
         if (empty($GLOBALS['xoTheme'])) {
             $this->js .= implode("", file(XOOPS_ROOT_PATH . "/class/textsanitizer/image/image.js"));
         } else {
             $GLOBALS['xoTheme']->addScript('/class/textsanitizer/image/image.js', array('type' => 'text/javascript'));
         }
         $button = "<input " . "   id='" . $this->getName() . "_preview_button'" . "   type='button' " . "   value='" . _PREVIEW . "' " . "   onclick=\"form_instantPreview('" . XOOPS_URL . "', '" . $this->getName() . "','" . XOOPS_URL . "/images', " . intval($this->doHtml) . ")\"" . " />";
         $ret .= "<br />" . "<div id='" . $this->getName() . "_hidden' style='display: block;'> " . "   <fieldset>" . "       <legend>" . $button . "</legend>" . "       <div id='" . $this->getName() . "_hidden_data'>" . _XOOPS_FORM_PREVIEW_CONTENT . "</div>" . "   </fieldset>" . "</div>";
     }
     // Load javascript
     if (empty($js_loaded)) {
         $javascript = ($this->js ? '<script language="JavaScript" type="text/javascript">' . $this->js . '</script>' : '') . '<script language="JavaScript" type="text/javascript" src="' . XOOPS_URL . '/include/formdhtmltextarea.js"></script>';
         $ret = $javascript . $ret;
         $js_loaded = true;
     }
     return $ret;
 }
Esempio n. 3
0
/**
 * Xoops legacy cp_functions
 *
 * @copyright       (c) 2000-2016 XOOPS Project (www.xoops.org)
 * @license             GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package             system
 * @subpackage          class
 * @since               2.3.0
 * @author              Taiwen Jiang <*****@*****.**>
 * @param $tpl
 */
function xoops_legacy_cp_header($tpl)
{
    global $xoopsConfig, $xoopsUser, $xoTheme;
    xoops_loadLanguage('cpanel', 'system');
    $xoTheme->addStylesheet(XOOPS_URL . '/xoops.css');
    $xoTheme->addStylesheet(XOOPS_URL . '/modules/system/themes/legacy/css/style.css');
    include XOOPS_CACHE_PATH . '/adminmenu.php';
    $moduleperm_handler = xoops_getHandler('groupperm');
    $admin_mids = $moduleperm_handler->getItemIds('module_admin', $xoopsUser->getGroups());
    $xoTheme->addScript(XOOPS_URL . '/include/layersmenu.js');
    $xoTheme->addScript('', '', '
        var thresholdY = 15; // in pixels; threshold for vertical repositioning of a layer
        var ordinata_margin = 20; // to start the layer a bit above the mouse vertical coordinate');
    $xoTheme->addScript('', '', $xoops_admin_menu_js . '
        function moveLayers() { ' . $xoops_admin_menu_ml . ' }
        function shutdown() { ' . $xoops_admin_menu_sd . ' }
        if (NS4) {
            document.onmousedown = function() { shutdown(); }
        } else {
            document.onclick = function() { shutdown(); }
        }');
    foreach (array_keys($xoops_admin_menu_ft) as $adm) {
        if (in_array($adm, $admin_mids)) {
            $admin_menu['content'] = $xoops_admin_menu_ft[$adm];
            $tpl->append_by_ref('admin_menu', $admin_menu);
            unset($admin_menu);
        }
    }
}
 /**
  * Constructor
  *
  * @param string $caption
  * @param string $name
  * @param mixed $value Pre-selected value (or array of them).
  *                                                 For an item with massive members, such as "Registered Users", "$value" should be used to store selected temporary users only instead of all members of that item
  * @param bool $include_anon Include user "anonymous"?
  * @param int $size Number or rows. "1" makes a drop-down-list.
  * @param bool $multiple Allow multiple selections?
  */
 function XoopsFormSelectUser($caption, $name, $include_anon = false, $value = null, $size = 1, $multiple = false)
 {
     $limit = 200;
     $select_element = new XoopsFormSelect('', $name, $value, $size, $multiple);
     if ($include_anon) {
         $select_element->addOption(0, $GLOBALS['xoopsConfig']['anonymous']);
     }
     $member_handler =& xoops_gethandler('member');
     $user_count = $member_handler->getUserCount();
     $value = is_array($value) ? $value : (empty($value) ? array() : array($value));
     if ($user_count > $limit && count($value) > 0) {
         $criteria = new CriteriaCompo(new Criteria('uid', '(' . implode(',', $value) . ')', 'IN'));
     } else {
         $criteria = new CriteriaCompo();
         $criteria->setLimit($limit);
     }
     $criteria->setSort('uname');
     $criteria->setOrder('ASC');
     $users = $member_handler->getUserList($criteria);
     $select_element->addOptionArray($users);
     if ($user_count <= $limit) {
         $this->XoopsFormElementTray($caption, "", $name);
         $this->addElement($select_element);
         return;
     }
     xoops_loadLanguage('findusers');
     $js_addusers = "<script type='text/javascript'>\r\n            function addusers(opts){\r\n                var num = opts.substring(0, opts.indexOf(':'));\r\n                opts = opts.substring(opts.indexOf(':')+1, opts.length);\r\n                var sel = xoopsGetElementById('" . $name . "');\r\n                var arr = new Array(num);\r\n                for (var n=0; n < num; n++) {\r\n                    var nm = opts.substring(0, opts.indexOf(':'));\r\n                    opts = opts.substring(opts.indexOf(':')+1, opts.length);\r\n                    var val = opts.substring(0, opts.indexOf(':'));\r\n                    opts = opts.substring(opts.indexOf(':')+1, opts.length);\r\n                    var txt = opts.substring(0, nm - val.length);\r\n                    opts = opts.substring(nm - val.length, opts.length);\r\n                    var added = false;\r\n                    for (var k = 0; k < sel.options.length; k++) {\r\n                        if(sel.options[k].value == val){\r\n                            added = true;\r\n                            break;\r\n                        }\r\n                    }\r\n                    if (added == false) {\r\n                        sel.options[k] = new Option(txt, val);\r\n                        sel.options[k].selected = true;\r\n                    }\r\n                }\r\n                return true;\r\n            }\r\n            </script>";
     $token = $GLOBALS['xoopsSecurity']->createToken();
     $action_tray = new XoopsFormElementTray("", " | ");
     $action_tray->addElement(new XoopsFormLabel('', '<a href="#" onclick="var sel = xoopsGetElementById(\'' . $name . '\');for (var i = sel.options.length-1; i >= 0; i--) {if (!sel.options[i].selected) {sel.options[i] = null;}}; return false;">' . _MA_USER_REMOVE . "</a>"));
     $action_tray->addElement(new XoopsFormLabel('', '<a href="#" onclick="openWithSelfMain(\'' . XOOPS_URL . '/include/findusers.php?target=' . $name . '&amp;multiple=' . $multiple . '&amp;token=' . $token . '\', \'userselect\', 800, 600, null); return false;" >' . _MA_USER_MORE . "</a>" . $js_addusers));
     $this->XoopsFormElementTray($caption, '<br /><br />', $name);
     $this->addElement($select_element);
     $this->addElement($action_tray);
 }
Esempio n. 5
0
 function header()
 {
     global $xoops, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsUser, $xoopsOption, $xoTheme, $xoopsTpl;
     ob_start();
     xoops_loadLanguage('admin', 'system');
     xoops_loadLanguage('cpanel', 'system');
     xoops_loadLanguage('modinfo', 'system');
     $xoopsLogger =& XoopsLogger::getInstance();
     $xoopsLogger->stopTime('Module init');
     $xoopsLogger->startTime('XOOPS output init');
     if (!headers_sent()) {
         header('Content-Type:text/html; charset=' . _CHARSET);
         header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
         header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
         header('Cache-Control: no-store, no-cache, must-revalidate');
         header("Cache-Control: post-check=0, pre-check=0", false);
         header("Pragma: no-cache");
     }
     require_once XOOPS_ROOT_PATH . '/class/template.php';
     require_once XOOPS_ROOT_PATH . '/class/theme.php';
     $adminThemeFactory = new xos_opal_AdminThemeFactory();
     $this->xoTheme =& $adminThemeFactory->createInstance(array('folderName' => $this->foldername, 'themesPath' => 'modules/system/class/gui'));
     $this->xoTheme->loadLocalization('admin');
     $this->template =& $this->xoTheme->template;
     $GLOBALS['xoTheme'] =& $this->xoTheme;
     $GLOBALS['adminTpl'] =& $this->xoTheme->template;
     $xoopsLogger->stopTime('XOOPS output init');
     $xoopsLogger->startTime('Module display');
     $xoopsPreload =& XoopsPreload::getInstance();
     $xoopsPreload->triggerEvent('system.class.gui.header');
 }
Esempio n. 6
0
 function art_load_lang_file($filename, $module = '', $default = 'english')
 {
     if (empty($module) && is_object($GLOBALS["xoopsModule"])) {
         $module = $GLOBALS["xoopsModule"]->getVar("dirname");
     }
     return xoops_loadLanguage($filename, $module);
 }
Esempio n. 7
0
/**
 * @param $options
 * @return string
 */
function about_block_page_edit($options)
{
    xoops_loadLanguage('blocks', 'about');
    $page_handler = xoops_getModuleHandler('page', 'about');
    $criteria = new CriteriaCompo();
    $criteria->add(new Criteria('page_status', 1), 'AND');
    $criteria->add(new Criteria('page_type', 1));
    $criteria->setSort('page_order');
    $criteria->setOrder('ASC');
    $fields = array('page_id', 'page_title', 'page_image');
    $pages = $page_handler->getAll($criteria, $fields, false);
    $page_title = '';
    foreach ($pages as $k => $v) {
        $page_title = '<a href="' . XOOPS_URL . '/modules/' . basename(dirname(__DIR__)) . '/index.php?page_id=' . $k . '" target="_blank">' . $v['page_title'] . '</a>';
        $options_page[$k] = empty($v['page_image']) ? $page_title : $page_title . '<img src="' . XOOPS_URL . '/modules/' . basename(dirname(__DIR__)) . '/assets/images/picture.png' . '" />';
    }
    include_once dirname(__DIR__) . '/include/xoopsformloader.php';
    $form = new XoopsBlockForm();
    $page_select = new XoopsFormRadio(_MB_ABOUT_BLOCKPAGE, 'options[0]', $options[0], '<br>');
    $page_select->addOptionArray($options_page);
    $form->addElement($page_select);
    $form->addElement(new XoopsFormText(_MB_ABOUT_TEXT_LENGTH, 'options[1]', 5, 5, $options[1]));
    $form->addElement(new XoopsFormText(_MB_ABOUT_VIEW_MORELINKTEXT, 'options[2]', 30, 50, $options[2]));
    $form->addElement(new XoopsFormRadioYN(_MB_ABOUT_DOTITLEIMAGE, 'options[3]', $options[3]));
    return $form->render();
}
Esempio n. 8
0
/**
 * Xoops legacy cp_functions
 *
 * @copyright   The XOOPS Project http://sf.net/projects/xoops/
 * @license     http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package     system
 * @subpackage  class
 * @since       2.3.0
 * @author      Taiwen Jiang <*****@*****.**>
 * @version     $Id: cp_functions.php 3542 2009-09-01 01:24:00Z trabis $
 */
function xoops_legacy_cp_header()
{
    global $xoopsConfig, $xoopsUser, $xoTheme;
    xoops_loadLanguage("cpanel", "system");
    $xoTheme->addStylesheet(XOOPS_URL . '/xoops.css');
    $xoTheme->addStylesheet(XOOPS_URL . '/modules/system/class/gui/default/css/style.css');
    include_once XOOPS_CACHE_PATH . '/adminmenu.php';
    $moduleperm_handler =& xoops_gethandler('groupperm');
    $admin_mids = $moduleperm_handler->getItemIds('module_admin', $xoopsUser->getGroups());
    $xoTheme->addScript(XOOPS_URL . '/include/layersmenu.js');
    $xoTheme->addScript('', '', '
        var thresholdY = 15; // in pixels; threshold for vertical repositioning of a layer
        var ordinata_margin = 20; // to start the layer a bit above the mouse vertical coordinate');
    $xoTheme->addScript('', '', $xoops_admin_menu_js . '
        function moveLayers() { ' . $xoops_admin_menu_ml . ' }
        function shutdown() { ' . $xoops_admin_menu_sd . ' }
        if (NS4) {
            document.onmousedown = function() { shutdown(); }
        } else {
            document.onclick = function() { shutdown(); }
        }');
    $logo = file_exists(XOOPS_THEME_PATH . "/" . $GLOBALS['xoopsConfig']['theme_set'] . "/images/logo.gif") ? XOOPS_THEME_URL . "/" . $GLOBALS['xoopsConfig']['theme_set'] . "/images/logo.gif" : XOOPS_URL . "/images/logo.gif";
    echo "\n        <body>\n        <table border='0' width='100%' cellspacing='0' cellpadding='0'>\n          <tr>\n            <td bgcolor='#2F5376'><a href='http://xoops.sourceforge.net/' rel='external'><img src='" . XOOPS_URL . "/modules/system/images/logo.gif' alt='" . htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES) . "' /></a></td>\n            <td align='right' bgcolor='#2F5376' colspan='2'><img src='" . XOOPS_URL . "/modules/system/images/xoops2.gif' alt='' /></td>\n          </tr>\n          <tr>\n            <td align='left' colspan='3' class='bg5'>\n              <table border='0' width='100%' cellspacing='0' cellpadding='0'>\n                <tr>\n                  <td width='1%'><img src='" . XOOPS_URL . "/modules/system/images/hbar_left.gif' width='10' height='23' /></td>\n                  <td class='hbar_middle'>&nbsp;<a href='" . XOOPS_URL . "/admin.php'>" . _CPHOME . "</a>&nbsp;|&nbsp;<a href='" . XOOPS_URL . "/admin.php?xoopsorgnews=1'>XOOPS News</a></td>\n                  <td class='hbar_middle' align='right'><a href='" . XOOPS_URL . "/user.php?op=logout'>" . _LOGOUT . "</a>&nbsp;|&nbsp;<a href='" . XOOPS_URL . "/'>" . _YOURHOME . "</a> &nbsp;</td>\n                  <td width='1%'><img src='" . XOOPS_URL . "/modules/system/images/hbar_right.gif' width='10' height='23' /></td>\n                </tr>\n              </table>\n            </td>\n          </tr>\n        </table>\n        <table border='0' cellpadding='0' cellspacing='0' width='100%'>\n          <tr>\n            <td width='2%' valign='top' class='bg5 bg_menu' align='center'></td>\n            <td width='15%' valign='top' class='bg5' align='center'><img src='" . XOOPS_URL . "/modules/system/images/menu.gif' /><br />\n              <table border='0' cellpadding='4' cellspacing='0' width='100%'>";
    foreach (array_keys($xoops_admin_menu_ft) as $adm) {
        if (in_array($adm, $admin_mids)) {
            echo "<tr><td align='center'>" . $xoops_admin_menu_ft[$adm] . "</td></tr>";
        }
    }
    echo "\n              </table>\n              <br />\n            </td>\n            <td align='left' valign='top' width='82%'>\n              <div class='content'><br />\n";
}
Esempio n. 9
0
/**
 * @param $xoopsModule
 *
 * @return bool|string
 */
function xoops_module_install_publisher(XoopsModule $xoopsModule)
{
    include_once dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
    xoops_loadLanguage('admin', $xoopsModule->getVar('dirname'));
    xoops_loadLanguage('modinfo', $xoopsModule->getVar('dirname'));
    $moduleDirName = $xoopsModule->getVar('dirname');
    include_once $GLOBALS['xoops']->path('modules/' . $moduleDirName . '/include/config.php');
    foreach (array_keys($uploadFolders) as $i) {
        PublisherUtilities::createFolder($uploadFolders[$i]);
    }
    $file = PUBLISHER_ROOT_PATH . '/assets/images/blank.png';
    foreach (array_keys($copyFiles) as $i) {
        $dest = $copyFiles[$i] . '/blank.png';
        PublisherUtilities::copyFile($file, $dest);
    }
    return true;
    /*
        include_once $GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname') . '/include/functions.php');
    
        $ret = true;
        $msg = '';
        // Create content directory
        $dir = $GLOBALS['xoops']->path('uploads/' . $xoopsModule->getVar('dirname') . '/content');
        if (!publisherMkdir($dir)) {
            $msg .= sprintf(_AM_PUBLISHER_DIRNOTCREATED, $dir);
        }
        if (empty($msg)) {
            return $ret;
        } else {
            return $msg;
        }
    */
}
Esempio n. 10
0
 function __construct()
 {
     xoops_loadLanguage("calendar");
     // Load static configurations
     $this->path = XOOPS_ROOT_PATH . "/class/calendar/";
     $this->url = XOOPS_URL . "/class/calendar/";
     $this->config = $this->loadConfig();
 }
Esempio n. 11
0
 function load($language = null)
 {
     if (class_exists('Xoopslocal')) {
         return true;
     }
     require $GLOBALS['xoops']->path('class/xoopslocal.php');
     xoops_loadLanguage('locale');
     return true;
 }
Esempio n. 12
0
 /**
  * construct
  */
 function __construct()
 {
     xoops_loadLanguage('captcha');
     // Load static configurations
     $this->path_basic = XOOPS_ROOT_PATH . '/class/captcha';
     $this->path_plugin = XOOPS_ROOT_PATH . '/Frameworks/captcha';
     $this->config = $this->loadConfig();
     $this->name = $this->config['name'];
 }
Esempio n. 13
0
function mymenus_adminMenu($currentoption = 0, $breadcrumb = '')
{
    include_once $GLOBALS['xoops']->path('class/template.php');
    include $GLOBALS['xoops']->path('modules/mymenus/admin/menu.php');
    xoops_loadLanguage('admin', 'mymenus');
    xoops_loadLanguage('modinfo', 'mymenus');
    $tpl = new XoopsTpl();
    $tpl->assign(array('modurl' => $GLOBALS['xoops']->url('modules/mymenus'), 'headermenu' => $mymenus_headermenu, 'adminmenu' => $mymenus_adminmenu, 'current' => $currentoption, 'breadcrumb' => $breadcrumb, 'headermenucount' => count($mymenus_headermenu)));
    $tpl->display($GLOBALS['xoops']->path('modules/mymenus/templates/static/mymenus_admin_adminmenu.html'));
}
Esempio n. 14
0
function subscribers_adminMenu($currentoption = 0, $breadcrumb = '')
{
    include_once XOOPS_ROOT_PATH . '/class/template.php';
    include XOOPS_ROOT_PATH . '/modules/subscribers/admin/menu.php';
    xoops_loadLanguage('admin', 'subscribers');
    xoops_loadLanguage('modinfo', 'subscribers');
    $tpl = new XoopsTpl();
    $tpl->assign(array('modurl' => XOOPS_URL . '/modules/subscribers', 'headermenu' => $subscribers_headermenu, 'adminmenu' => $subscribers_adminmenu, 'current' => $currentoption, 'breadcrumb' => $breadcrumb, 'headermenucount' => count($subscribers_headermenu)));
    $tpl->display(XOOPS_ROOT_PATH . '/modules/subscribers/templates/static/subscribers_admin_menu.html');
}
Esempio n. 15
0
 /**
  * Constructor
  */
 function __construct(XoopsModule $module)
 {
     parent::__construct($this);
     //$this->setTemplate(XMF_ROOT_PATH . '/templates/xmf_admin.html');
     $this->_obj =& $module;
     xoops_loadLanguage('main', 'xmf');
     if (is_object($GLOBALS['xoTheme'])) {
         $GLOBALS['xoTheme']->addStylesheet(XMF_CSS_URL . '/admin.css');
     }
 }
Esempio n. 16
0
 /**
  * @param null $language
  *
  * @return bool
  */
 static function load($language = null)
 {
     if (class_exists('Xoopslocal')) {
         return true;
     }
     require_once $GLOBALS['xoops']->path('class/xoopslocal.php');
     //XoopsLocal is inside language file, let us load it
     xoops_loadLanguage('locale');
     return true;
 }
Esempio n. 17
0
 function tag_get_delimiter()
 {
     xoops_loadLanguage("config", "tag");
     if (!empty($GLOBALS["tag_delimiter"])) {
         return $GLOBALS["tag_delimiter"];
     }
     $moduleConfig = tag_load_config();
     if (!empty($moduleConfig["tag_delimiter"])) {
         return $moduleConfig["tag_delimiter"];
     }
     return array(",", " ", "|", ";");
 }
Esempio n. 18
0
 function _getModuleMenus($module, $pid)
 {
     global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig;
     static $id = -1;
     $ret = array();
     //Sanitizing $module
     if (preg_match('/[^a-z0-9\\/\\\\_.:-]/i', $module)) {
         return $ret;
     }
     $path = "modules/{$module}";
     $file = $GLOBALS['xoops']->path("{$path}/xoops_version.php");
     if (!file_exists($file)) {
         return $ret;
     }
     xoops_loadLanguage('modinfo', $module);
     $force = true;
     $overwrite = false;
     if ($force && (!is_object($xoopsModule) || $xoopsModule->getVar('dirname') != $module)) {
         $_xoopsModule = is_object($xoopsModule) ? $xoopsModule : $xoopsModule;
         $_xoopsModuleConfig = is_object($xoopsModuleConfig) ? $xoopsModuleConfig : $xoopsModuleConfig;
         $module_handler =& xoops_gethandler('module');
         $xoopsModule =& $module_handler->getByDirname($module);
         $GLOBALS['xoopsModule'] =& $xoopsModule;
         if (is_object($xoopsModule)) {
             $config_handler =& xoops_gethandler('config');
             $xoopsModuleConfig =& $config_handler->getConfigsByCat(0, $xoopsModule->getVar('mid'));
             $GLOBALS['xoopsModuleConfig'] =& $xoopsModuleConfig;
         }
         $overwrite = true;
     }
     $modversion['sub'] = array();
     include $file;
     $handler = xoops_getModuleHandler('menu', 'mymenus');
     foreach ($modversion['sub'] as $menu) {
         $obj = $handler->create();
         $obj->setVar('title', $menu['name']);
         $obj->setVar('alt_title', $menu['name']);
         $obj->setVar('link', $GLOBALS['xoops']->url("{$path}/{$menu['url']}"));
         $obj->setVar('id', $id);
         $obj->setVar('pid', $pid);
         $ret[] = $obj->getValues();
         $id--;
     }
     if ($overwrite) {
         $xoopsModule =& $_xoopsModule;
         $GLOBALS['xoopsModule'] =& $xoopsModule;
         $xoopsModuleConfig =& $_xoopsModuleConfig;
         $GLOBALS['xoopsModuleConfig'] =& $xoopsModuleConfig;
     }
     return $ret;
 }
Esempio n. 19
0
 function do_transfer(&$data)
 {
     eval(parent::do_transfer());
     include XOOPS_ROOT_PATH . "/header.php";
     xoops_loadLanguage('admin', 'spotlight');
     $page_handler =& xoops_getmodulehandler('page', 'spotlight');
     $page_obj =& $page_handler->create();
     $var_arr = array('page_title' => $data["title"], 'page_desc' => $data["summary"], 'page_link' => $data["url"], 'id' => $data["id"]);
     $page_obj->assignVars($var_arr);
     $form = $page_obj->getForm($this->config["url"]);
     $form->display();
     include XOOPS_ROOT_PATH . "/footer.php";
     exit;
 }
Esempio n. 20
0
/**
 * Extended User Profile
 *
 * 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.
 *
 * @copyright       The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         profile
 * @since           2.3.0
 * @author          Jan Pedersen
 * @author          Taiwen Jiang <*****@*****.**>
 * @version         $Id: install.php 3749 2009-10-17 14:23:04Z trabis $
 */
function xoops_module_install_profile($module)
{
    global $module_id;
    $module_id = $module->getVar('mid');
    xoops_loadLanguage('user');
    // Create registration steps
    profile_install_addStep(_PROFILE_MI_STEP_BASIC, '', 1, 1);
    profile_install_addStep(_PROFILE_MI_STEP_COMPLEMENTARY, '', 2, 1);
    // Create categories
    profile_install_addCategory(_PROFILE_MI_CATEGORY_PERSONAL, 1);
    profile_install_addCategory(_PROFILE_MI_CATEGORY_MESSAGING, 2);
    profile_install_addCategory(_PROFILE_MI_CATEGORY_SETTINGS, 3);
    profile_install_addCategory(_PROFILE_MI_CATEGORY_COMMUNITY, 4);
    // Add user fields
    xoops_loadLanguage('notification');
    xoops_loadLanguage('main', $module->getVar('dirname', 'n'));
    include_once $GLOBALS['xoops']->path('include/notification_constants.php');
    $umode_options = array('nest' => _NESTED, 'flat' => _FLAT, 'thread' => _THREADED);
    $uorder_options = array(0 => _OLDESTFIRST, 1 => _NEWESTFIRST);
    $notify_mode_options = array(XOOPS_NOTIFICATION_MODE_SENDALWAYS => _NOT_MODE_SENDALWAYS, XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE => _NOT_MODE_SENDONCE, XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT => _NOT_MODE_SENDONCEPERLOGIN);
    $notify_method_options = array(XOOPS_NOTIFICATION_METHOD_DISABLE => _NOT_METHOD_DISABLE, XOOPS_NOTIFICATION_METHOD_PM => _NOT_METHOD_PM, XOOPS_NOTIFICATION_METHOD_EMAIL => _NOT_METHOD_EMAIL);
    profile_install_addField('name', _US_REALNAME, '', 1, 'textbox', 1, 1, 1, array(), 2, 255);
    profile_install_addField('user_from', _US_LOCATION, '', 1, 'textbox', 1, 2, 1, array(), 2, 255);
    profile_install_addField('timezone_offset', _US_TIMEZONE, '', 1, 'timezone', 1, 3, 1, array(), 2, 0);
    profile_install_addField('user_occ', _US_OCCUPATION, '', 1, 'textbox', 1, 4, 1, array(), 2, 255);
    profile_install_addField('user_intrest', _US_INTEREST, '', 1, 'textbox', 1, 5, 1, array(), 2, 255);
    profile_install_addField('bio', _US_EXTRAINFO, '', 1, 'textarea', 2, 6, 1, array(), 2, 0);
    profile_install_addField('user_regdate', _US_MEMBERSINCE, '', 1, 'datetime', 3, 7, 0, array(), 0, 10);
    profile_install_addField('user_icq', _US_ICQ, '', 2, 'textbox', 1, 1, 1, array(), 2, 255);
    profile_install_addField('user_aim', _US_AIM, '', 2, 'textbox', 1, 2, 1, array(), 2, 255);
    profile_install_addField('user_yim', _US_YIM, '', 2, 'textbox', 1, 3, 1, array(), 2, 255);
    profile_install_addField('user_msnm', _US_MSNM, '', 2, 'textbox', 1, 4, 1, array(), 2, 255);
    profile_install_addField('user_viewemail', _US_ALLOWVIEWEMAIL, '', 3, 'yesno', 3, 1, 1, array(), 2, 1, false);
    profile_install_addField('attachsig', _US_SHOWSIG, '', 3, 'yesno', 3, 2, 1, array(), 0, 1, false);
    profile_install_addField('user_mailok', _US_MAILOK, '', 3, 'yesno', 3, 3, 1, array(), 2, 1, false);
    profile_install_addField('theme', _PROFILE_MA_THEME, '', 3, 'theme', 1, 4, 1, array(), 0, 0, false);
    profile_install_addField('umode', _US_CDISPLAYMODE, '', 3, 'select', 3, 5, 1, $umode_options, 0, 0, false);
    profile_install_addField('uorder', _US_CSORTORDER, '', 3, 'select', 3, 6, 1, $uorder_options, 0, 0, false);
    profile_install_addField('notify_mode', _NOT_NOTIFYMODE, '', 3, 'select', 3, 7, 1, $notify_mode_options, 0, 0, false);
    profile_install_addField('notify_method', _NOT_NOTIFYMETHOD, '', 3, 'select', 3, 8, 1, $notify_method_options, 0, 0, false);
    profile_install_addField('url', _PROFILE_MI_URL_TITLE, '', 4, 'textbox', 1, 1, 1, array(), 2, 255);
    profile_install_addField('posts', _US_POSTS, '', 4, 'textbox', 3, 2, 0, array(), 0, 255);
    profile_install_addField('rank', _US_RANK, '', 4, 'rank', 3, 3, 2, array(), 0, 0);
    profile_install_addField('last_login', _US_LASTLOGIN, '', 4, 'datetime', 3, 4, 0, array(), 0, 10);
    profile_install_addField('user_sig', _US_SIGNATURE, '', 4, 'textarea', 1, 5, 1, array(), 0, 0);
    profile_install_initializeProfiles();
    return true;
}
Esempio n. 21
0
 /**
  * Constructor
  * 
  * @param    string    $name       "name" attribute
  * @param    int        $size        Size
  * @param    int        $maxlength    Maximum length of text
  * @param    mixed    $value      Initial text or itemid
  * @param    int        $catid      category id (applicable if $value is itemid)
  */
 function XoopsFormTag($name, $size, $maxlength, $value = null, $catid = 0)
 {
     include XOOPS_ROOT_PATH . "/modules/tag/include/vars.php";
     if (!is_object($GLOBALS["xoopsModule"]) || "tag" != $GLOBALS["xoopsModule"]->getVar("dirname")) {
         xoops_loadLanguage("main", "tag");
     }
     $value = empty($value) ? "" : $value;
     // itemid
     if (!empty($value) && is_numeric($value) && is_object($GLOBALS["xoopsModule"])) {
         $modid = $GLOBALS["xoopsModule"]->getVar("mid");
         $tag_handler =& xoops_getmodulehandler("tag", "tag");
         if ($tags = $tag_handler->getByItem($value, $modid, $catid)) {
             $value = htmlspecialchars(implode(", ", $tags));
         } else {
             $value = "";
         }
     }
     $caption = TAG_MD_TAGS;
     $this->XoopsFormText($caption, $name, $size, $maxlength, $value);
 }
Esempio n. 22
0
function presenter_notify_iteminfo($category, $item_id)
{
    global $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
    if (empty($xoopsModule) || $xoopsModule->getVar('dirname') !== 'presenter') {
        $module_handler =& xoops_gethandler('module');
        $module =& $module_handler->getByDirname('presenter');
        $config_handler =& xoops_gethandler('config');
        $config =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
    } else {
        $module =& $xoopsModule;
        $config =& $xoopsModuleConfig;
    }
    xoops_loadLanguage('main', 'presenter');
    if ($category === 'global') {
        $item['name'] = '';
        $item['url'] = '';
        return $item;
    }
    global $xoopsDB;
    if ($category === 'category') {
        // Assume we have a valid category id
        $sql = 'SELECT slides_cid FROM ' . $xoopsDB->prefix('presenter_slides') . ' WHERE slides_cid = ' . $item_id;
        $result = $xoopsDB->query($sql);
        // TODO: error check
        $result_array = $xoopsDB->fetchArray($result);
        $item['name'] = $result_array['slides_cid'];
        $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/slides.php?slides_cid=' . $item_id;
        return $item;
    }
    if ($category === 'slides') {
        // Assume we have a valid link id
        $sql = 'SELECT slides_cid, slides_cid FROM ' . $xoopsDB->prefix('slides') . ' WHERE slides_id = ' . $item_id;
        $result = $xoopsDB->query($sql);
        // TODO: error check
        $result_array = $xoopsDB->fetchArray($result);
        $item['name'] = $result_array['title'];
        $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/slides.php?slides_cid=' . $result_array['slides_cid'] . '&amp;slides_id=' . $item_id;
        return $item;
    }
    return '';
}
Esempio n. 23
0
 function __construct($aboutTitle = 'About')
 {
     xoops_loadLanguage('about', 'mytabs');
     $this->_aboutTitle = $aboutTitle;
     $this->_lang_developer_contributor = _AB_MYTABS_DEVELOPER_CONTRIBUTOR;
     $this->_lang_developer_website = _AB_MYTABS_DEVELOPER_WEBSITE;
     $this->_lang_developer_email = _AB_MYTABS_DEVELOPER_EMAIL;
     $this->_lang_developer_credits = _AB_MYTABS_DEVELOPER_CREDITS;
     $this->_lang_module_info = _AB_MYTABS_MODULE_INFO;
     $this->_lang_module_status = _AB_MYTABS_MODULE_STATUS;
     $this->_lang_module_release_date = _AB_MYTABS_MODULE_RELEASE_DATE;
     $this->_lang_module_demo = _AB_MYTABS_MODULE_DEMO;
     $this->_lang_module_support = _AB_MYTABS_MODULE_SUPPORT;
     $this->_lang_module_bug = _AB_MYTABS_MODULE_BUG;
     $this->_lang_module_submit_bug = _AB_MYTABS_MODULE_SUBMIT_BUG;
     $this->_lang_module_feature = _AB_MYTABS_MODULE_FEATURE;
     $this->_lang_module_submit_feature = _AB_MYTABS_MODULE_SUBMIT_FEATURE;
     $this->_lang_module_disclaimer = _AB_MYTABS_MODULE_DISCLAIMER;
     $this->_lang_author_word = _AB_MYTABS_AUTHOR_WORD;
     $this->_lang_version_history = _AB_MYTABS_VERSION_HISTORY;
 }
Esempio n. 24
0
function mytabs_adminmenu($currentoption = 0, $breadcrumb = '')
{
    /* Nice buttons styles */
    echo "\r\n        <style type='text/css'>\r\n        #buttontop { float:left; width:100%; background: #e7e7e7; font-size:93%; line-height:normal; border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black; margin: 0; }\r\n        #buttonbar { float:left; width:100%; background: #e7e7e7 url('" . XOOPS_URL . "/modules/mytabs/images/bg.png') repeat-x left bottom; font-size:93%; line-height:normal; border-left: 1px solid black; border-right: 1px solid black; margin-bottom: 12px; }\r\n        #buttonbar ul { margin:0; margin-top: 15px; padding:10px 10px 0; list-style:none; }\r\n        #buttonbar li { display:inline; margin:0; padding:0; }\r\n        #buttonbar a { float:left; background:url('" . XOOPS_URL . "/modules/mytabs/images/left_both.png') no-repeat left top; margin:0; padding:0 0 0 9px; border-bottom:1px solid #000; text-decoration:none; }\r\n        #buttonbar a span { float:left; display:block; background:url('" . XOOPS_URL . "/modules/mytabs/images/right_both.png') no-repeat right top; padding:5px 15px 4px 6px; font-weight:bold; color:#765; }\r\n        /* Commented Backslash Hack hides rule from IE5-Mac \\*/\r\n        #buttonbar a span {float:none;}\r\n        /* End IE5-Mac hack */\r\n        #buttonbar a:hover span { color:#333; }\r\n        #buttonbar #current a { background-position:0 -150px; border-width:0; }\r\n        #buttonbar #current a span { background-position:100% -150px; padding-bottom:5px; color:#333; }\r\n        #buttonbar a:hover { background-position:0% -150px; }\r\n        #buttonbar a:hover span { background-position:100% -150px; }\r\n        </style>\r\n    ";
    global $xoopsModule, $xoopsConfig;
    $tblColors = array('', '', '');
    if ($currentoption >= 0) {
        $tblColors[$currentoption] = 'current';
    }
    xoops_loadLanguage('modinfo', 'mytabs');
    echo "<div id='buttontop'>";
    echo "<table style=\"width: 100%; padding: 0; \" cellspacing=\"0\"><tr>";
    echo "<td style=\"width: 60%; font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;\"><a class=\"nobutton\" href=\"../../system/admin.php?fct=blocksadmin&amp;selvis=-1&amp;selmod=-2&amp;selgrp=-1&amp;selgen=" . $xoopsModule->getVar('mid') . "\">" . _MI_MYTABS_ADMMENU3 . "</a>";
    echo "<td style=\"width: 40%; font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;\"><b>" . $xoopsModule->name() . "  " . _AM_MYTABS_MODULEADMIN . "</b> " . $breadcrumb . "</td>";
    echo "</tr></table>";
    echo "</div>";
    echo "<div id='buttonbar'>";
    echo "<ul>";
    echo "<li id='" . $tblColors[0] . "'><a href=\"index.php\"\"><span>" . _MI_MYTABS_ADMMENU1 . "</span></a></li>\n";
    echo "<li id='" . $tblColors[2] . "'><a href=\"about.php\"\"><span>" . _MI_MYTABS_ADMMENU2 . "</span></a></li>\n";
    echo "</ul></div><div>&nbsp;</div>";
}
Esempio n. 25
0
/**
 * Display tag list
 *
 * @var        array    $tags    array of tag string
 * OR
 * @var        integer    $itemid
 * @var        integer    $catid
 * @var        integer    $modid
 *
 * @return     array    (subject language, array of linked tags)
 */
function tagBar($tags, $catid = 0, $modid = 0)
{
    static $loaded, $delimiter;
    if (empty($tags)) {
        return array();
    }
    if (!isset($loaded)) {
        include XOOPS_ROOT_PATH . "/modules/tag/include/vars.php";
        include_once XOOPS_ROOT_PATH . "/modules/tag/include/functions.php";
        tag_define_url_delimiter();
        if (!is_object($GLOBALS["xoopsModule"]) || "tag" != $GLOBALS["xoopsModule"]->getVar("dirname")) {
            xoops_loadLanguage("main", "tag");
        }
        $loaded = 1;
        $delimiter = @file_exists(XOOPS_ROOT_PATH . "/modules/tag/images/delimiter.gif") ? "<img src=\"" . XOOPS_URL . "/modules/tag/images/delimiter.gif\" alt=\"\" />" : "<img src=\"" . XOOPS_URL . "/images/pointer.gif\" alt=\"\" />";
    }
    // itemid
    if (is_numeric($tags)) {
        if (empty($modid) && is_object($GLOBALS["xoopsModule"])) {
            $modid = $GLOBALS["xoopsModule"]->getVar("mid");
        }
        $tag_handler =& xoops_getmodulehandler("tag", "tag");
        if (!($tags = $tag_handler->getByItem($tags, $modid, $catid))) {
            return array();
        }
        // if ready, do nothing
    } elseif (is_array($tags)) {
        // parse
    } elseif (!($tags = tag_parse_tag($tags))) {
        return array();
    }
    $tags_data = array();
    foreach ($tags as $tag) {
        $tags_data[] = "<a href=\"" . XOOPS_URL . "/modules/" . $GLOBALS["xoopsModule"]->getVar("dirname") . "/view.tag.php" . URL_DELIMITER . urlencode($tag) . "\" title=\"" . htmlspecialchars($tag) . "\">" . htmlspecialchars($tag) . "</a>";
    }
    return array("title" => TAG_MD_TAGS, "delimiter" => $delimiter, "tags" => $tags_data);
}
Esempio n. 26
0
//  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 //
//  ------------------------------------------------------------------------ //
//$xoopsOption['pagetype'] = 'user';
include 'mainfile.php';
$module_handler = xoops_gethandler('module');
$profile_module = $module_handler->getByDirname('profile');
if ($profile_module && $profile_module->getVar('isactive')) {
    header("location: ./modules/profile/userinfo.php" . (empty($_SERVER['QUERY_STRING']) ? "" : "?" . $_SERVER['QUERY_STRING']));
    exit;
}
xoops_loadLanguage('user');
include_once XOOPS_ROOT_PATH . '/class/module.textsanitizer.php';
include_once XOOPS_ROOT_PATH . '/modules/system/constants.php';
$uid = intval($_GET['uid']);
if ($uid <= 0) {
    redirect_header('index.php', 3, _US_SELECTNG);
    exit;
}
$gperm_handler =& xoops_gethandler('groupperm');
$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
$isAdmin = $gperm_handler->checkRight('system_admin', XOOPS_SYSTEM_USER, $groups);
/*
// Check access permission
if ( $isAdmin || ( is_object($xoopsUser) && $uid == $xoopsUser->getVar('uid') ) ) {
} else {
    $xoopsConfigUser = $config_handler->getConfigsByCat(XOOPS_CONF_USER);
Esempio n. 27
0
        $denied = false;
    }
} else {
    if (is_object($xoopsUser) && $xoopsUser->isAdmin()) {
        $denied = false;
    }
}
if ($denied) {
    xoops_error(_NOPERM);
    exit;
}
$token = isset($_REQUEST['token']) ? $_REQUEST['token'] : '';
$name_form = 'memberslist';
$name_userid = 'uid' . (!empty($_REQUEST['multiple']) ? '[]' : '');
$name_username = '******' . (!empty($_REQUEST['multiple']) ? '[]' : '');
xoops_loadLanguage('findusers');
/**
 * Enter description here...
 *
 */
class XoopsRank extends XoopsObject
{
    /**
     * Construct
     *
     */
    function __construct()
    {
        $this->XoopsRank();
    }
    /**
Esempio n. 28
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @copyright       The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
 * @package         kernel
 * @since           2.0.0
 * @author          Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/
 * @version         $Id: comment_new.php 12537 2014-05-19 14:19:33Z beckmi $
 */
defined('XOOPS_ROOT_PATH') || die('Restricted access');
include_once $GLOBALS['xoops']->path('include/comment_constants.php');
if ('system' != $xoopsModule->getVar('dirname') && XOOPS_COMMENT_APPROVENONE == $xoopsModuleConfig['com_rule'] || !is_object($xoopsUser) && !$xoopsModuleConfig['com_anonpost'] || !is_object($xoopsModule)) {
    redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
}
xoops_loadLanguage('comment');
$com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0;
if ($com_itemid > 0) {
    include_once $GLOBALS['xoops']->path('header.php');
    if (isset($com_replytitle)) {
        if (isset($com_replytext)) {
            echo '<table cellpadding="4" cellspacing="1" width="98%" class="outer">
                  <tr><td class="head">' . $com_replytitle . '</td></tr>
                  <tr><td><br />' . $com_replytext . '<br /></td></tr>
                  </table>';
        }
        $myts =& MyTextSanitizer::getInstance();
        $com_title = $myts->htmlSpecialChars($com_replytitle);
        if (!preg_match("/^" . _RE . "/i", $com_title)) {
            $com_title = _RE . " " . xoops_substr($com_title, 0, 56);
        }
Esempio n. 29
0
include_once XOOPS_ROOT_PATH . '/class/preload.php';
include_once XOOPS_ROOT_PATH . '/class/logger/xoopslogger.php';
include_once XOOPS_ROOT_PATH . '/class/module.textsanitizer.php';
include_once XOOPS_ROOT_PATH . '/class/database/databasefactory.php';
require_once XOOPS_ROOT_PATH . '/kernel/object.php';
require_once XOOPS_ROOT_PATH . '/class/criteria.php';
require_once XOOPS_ROOT_PATH . '/class/xoopskernel.php';
$xoops = new xos_kernel_Xoops2();
$xoops->pathTranslation();
$xoopsLogger =& XoopsLogger::getInstance();
$xoopsLogger->startTime();
define('XOOPS_DB_PROXY', 1);
$xoopsDB =& XoopsDatabaseFactory::getDatabaseConnection();
//End of Xoops globals include
if (!defined('XHELP_CONSTANTS_INCLUDED')) {
    include_once XOOPS_ROOT_PATH . '/modules/xhelp/include/constants.php';
}
require_once XHELP_BASE_PATH . '/functions.php';
$module_handler =& xoops_gethandler('module');
$module =& $module_handler;
$config_handler =& xoops_gethandler('config');
$xoopsConfig =& $config_handler->getConfigsByCat(XOOPS_CONF);
xoops_loadLanguage('global');
$xoopsConfigUser = array();
$myConfigs =& $config_handler->getConfigs();
foreach ($myConfigs as $myConf) {
    $xoopsConfigUser[$myConf->getVar('conf_name')] = $myConf->getVar('conf_value');
}
$xoopsModule =& xhelpGetModule();
$xoopsModuleConfig =& xhelpGetModuleConfig();
xhelpIncludeLang('main');
Esempio n. 30
0
    $moduleperm_handler = xoops_getHandler('groupperm');
    if ($xoopsUser) {
        if (!$moduleperm_handler->checkRight('module_read', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
            redirect_header(XOOPS_URL, 1, _NOPERM, false);
        }
        $xoopsUserIsAdmin = $xoopsUser->isAdmin($xoopsModule->getVar('mid'));
    } else {
        if (!$moduleperm_handler->checkRight('module_read', $xoopsModule->getVar('mid'), XOOPS_GROUP_ANONYMOUS)) {
            redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
        }
    }
    if ($xoopsModule->getVar('hasconfig') == 1 || $xoopsModule->getVar('hascomments') == 1 || $xoopsModule->getVar('hasnotification') == 1) {
        $xoopsModuleConfig = $config_handler->getConfigsByCat(0, $xoopsModule->getVar('mid'));
    }
    chdir('modules/' . $xoopsConfig['startpage'] . '/');
    xoops_loadLanguage('main', $xoopsModule->getVar('dirname', 'n'));
    $parsed = parse_url(XOOPS_URL);
    $url = isset($parsed['scheme']) ? $parsed['scheme'] . '://' : 'http://';
    if (isset($parsed['host'])) {
        $url .= $parsed['host'];
        if (isset($parsed['port'])) {
            $url .= ':' . $parsed['port'];
        }
    } else {
        $url .= $_SERVER['HTTP_HOST'];
    }
    $_SERVER['REQUEST_URI'] = substr(XOOPS_URL, strlen($url)) . '/modules/' . $xoopsConfig['startpage'] . '/index.php';
    include $GLOBALS['xoops']->path('modules/' . $xoopsConfig['startpage'] . '/index.php');
    exit;
} else {
    $xoopsOption['show_cblock'] = 1;