Example #1
0
<?php

/*
 * Created on 2011/11/17 by nao-pon http://xoops.hypweb.net/
 * $Id: xpwiki_render.php,v 1.2 2011/11/18 04:49:14 nao-pon Exp $
 */
if (defined('XOOPS_CUBE_LEGACY')) {
    if (is_file(XOOPS_ROOT_PATH . '/preload/SetupHyp_TextFilter.class.php')) {
        $config['error'][] = hypconf_constant($constpref . '_TEXTFILTER_ALREADY_EXISTS');
    }
    if (!defined('LEGACY_BASE_VERSION') || version_compare(LEGACY_BASE_VERSION, '2.2.1.0', '<')) {
        $config['error'][] = hypconf_constant($constpref . '_XCL_REQUERE_2_2_1');
    }
    $config[] = array('name' => 'xpwiki_render_dirname', 'title' => $constpref . '_XPWIKI_RENDER_DIRNAME', 'description' => $constpref . '_XPWIKI_RENDER_DIRNAME_DESC', 'formtype' => 'select', 'valuetype' => 'text', 'options' => 'xpwikis');
    $config[] = array('name' => 'xpwiki_render_use_wikihelper', 'title' => $constpref . '_XPWIKI_RENDER_USE_WIKIHELPER', 'description' => $constpref . '_XPWIKI_RENDER_USE_WIKIHELPER_DESC', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 0);
    $config[] = array('name' => 'xpwiki_render_notuse_wikihelper_modules', 'title' => $constpref . '_XPWIKI_RENDER_NOTUSE_WIKIHELPER_MODULES', 'description' => $constpref . '_XPWIKI_RENDER_NOTUSE_WIKIHELPER_MODULES_DESC', 'formtype' => 'check', 'valuetype' => 'array', 'options' => 'modules');
} else {
    $config['error'][] = hypconf_constant($constpref . '_ADMENU_XPWIKI_RENDER') . ': ' . hypconf_constant($constpref . '_REQUERE_XCL');
}
Example #2
0
<?php

include_once dirname(__FILE__) . '/include/admin_func.php';
$constpref = '_MI_' . strtoupper($mydirname);
$adminmenu = array(array('title' => hypconf_constant($constpref . '_ADMENU_CONTENTSADMIN'), 'link' => 'admin/index.php'), array('title' => hypconf_constant($constpref . '_ADMENU_MAIN_SWITCH'), 'link' => 'admin/index.php?mode=admin&page=main_switch'), array('title' => hypconf_constant($constpref . '_ADMENU_K_TAI_CONF'), 'link' => 'admin/index.php?mode=admin&page=k_tai_conf'), array('title' => hypconf_constant($constpref . '_ADMENU_XPWIKI_RENDER'), 'link' => 'admin/index.php?mode=admin&page=xpwiki_render'), array('title' => hypconf_constant($constpref . '_ADMENU_SPAM_BLOCK'), 'link' => 'admin/index.php?mode=admin&page=spam_block'), array('title' => 'PHP info', 'link' => 'admin/index.php?mode=admin&page=phpinfo'));
$adminmenu4altsys = array(array('title' => hypconf_constant($constpref . '_ADMENU_MYBLOCKSADMIN'), 'link' => 'admin/index.php?mode=admin&lib=altsys&page=myblocksadmin'));
Example #3
0
<?php

/*
 * Created on 2011/12/12 by nao-pon http://hypweb.net/
 * $Id: spam_block.php,v 1.1 2011/12/13 08:12:18 nao-pon Exp $
 */
$config['main_switch'] = 'use_post_spam_filter';
$config[] = array('name' => 'use_mail_notify', 'title' => $constpref . '_USE_MAIL_NOTIFY', 'description' => $constpref . '_USE_MAIL_NOTIFY_DESC', 'formtype' => 'textbox', 'valuetype' => 'int', 'size' => 4);
$config[] = array('name' => 'send_mail_interval', 'title' => $constpref . '_SEND_MAIL_INTERVAL', 'description' => $constpref . '_SEND_MAIL_INTERVAL_DESC', 'formtype' => 'textbox', 'valuetype' => 'int', 'size' => 4);
$config[] = array('name' => 'post_spam_a', 'title' => $constpref . '_POST_SPAM_A', 'description' => $constpref . '_POST_SPAM_A_DESC', 'formtype' => 'textbox', 'valuetype' => 'int', 'size' => 4);
$config[] = array('name' => 'post_spam_bb', 'title' => $constpref . '_POST_SPAM_BB', 'description' => $constpref . '_POST_SPAM_BB_DESC', 'formtype' => 'textbox', 'valuetype' => 'int', 'size' => 4);
$config[] = array('name' => 'post_spam_url', 'title' => $constpref . '_POST_SPAM_URL', 'description' => $constpref . '_POST_SPAM_URL_DESC', 'formtype' => 'textbox', 'valuetype' => 'int', 'size' => 4);
$config[] = array('name' => 'post_spam_unhost', 'title' => $constpref . '_POST_SPAM_UNHOST', 'description' => $constpref . '_POST_SPAM_UNHOST_DESC', 'formtype' => 'textbox', 'valuetype' => 'int', 'size' => 4);
$config[] = array('name' => 'post_spam_host', 'title' => $constpref . '_POST_SPAM_HOST', 'description' => $constpref . '_POST_SPAM_HOST_DESC', 'formtype' => 'textbox', 'valuetype' => 'int', 'size' => 4);
$config[] = array('name' => 'post_spam_word', 'title' => $constpref . '_POST_SPAM_WORD', 'description' => $constpref . '_POST_SPAM_WORD_DESC', 'formtype' => 'textbox', 'valuetype' => 'int', 'size' => 4);
$config[] = array('name' => 'post_spam_filed', 'title' => $constpref . '_POST_SPAM_FILED', 'description' => $constpref . '_POST_SPAM_FILED_DESC', 'formtype' => 'textbox', 'valuetype' => 'int', 'size' => 4);
$config[] = array('name' => 'post_spam_trap', 'title' => $constpref . '_POST_SPAM_TRAP', 'description' => $constpref . '_POST_SPAM_TRAP_DESC', 'formtype' => 'textbox', 'valuetype' => 'text', 'size' => 8);
$config[] = array('name' => 'post_spam_user', 'title' => $constpref . '_POST_SPAM_USER', 'description' => $constpref . '_POST_SPAM_USER_DESC', 'formtype' => 'textbox', 'valuetype' => 'int', 'size' => 4);
$config[] = array('name' => 'post_spam_guest', 'title' => $constpref . '_POST_SPAM_GUEST', 'description' => $constpref . '_POST_SPAM_GUEST_DESC', 'formtype' => 'textbox', 'valuetype' => 'int', 'size' => 4);
$config[] = array('name' => 'post_spam_badip', 'title' => $constpref . '_POST_SPAM_BADIP', 'description' => $constpref . '_POST_SPAM_BADIP_DESC', 'formtype' => 'textbox', 'valuetype' => 'int', 'size' => 4);
$config[] = array('name' => 'post_spam_badip_ttl', 'title' => $constpref . '_POST_SPAM_BADIP_TTL', 'description' => $constpref . '_POST_SPAM_BADIP_TTL_DESC', 'formtype' => 'textbox', 'valuetype' => 'int', 'size' => 10);
$config[] = array('name' => 'post_spam_badip_forever', 'title' => $constpref . '_POST_SPAM_BADIP_FOREVER', 'description' => $constpref . '_POST_SPAM_BADIP_FOREVER_DESC', 'formtype' => 'textbox', 'valuetype' => 'int', 'size' => 10);
$config[] = array('name' => 'post_spam_badip_ttl0', 'title' => $constpref . '_POST_SPAM_BADIP_TTL0', 'description' => $constpref . '_POST_SPAM_BADIP_TTL0_DESC', 'formtype' => 'textbox', 'valuetype' => 'int', 'size' => 10);
$config[] = array('name' => 'post_spam_site_auto_regist', 'title' => $constpref . '_POST_SPAM_SITE_AUTO_REGIST', 'description' => $constpref . '_POST_SPAM_SITE_AUTO_REGIST_DESC', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 1);
$config[] = array('name' => 'post_spam_safe_url', 'title' => $constpref . '_POST_SPAM_SAFE_URL', 'description' => $constpref . '_POST_SPAM_SAFE_URL_DESC', 'formtype' => 'textbox', 'valuetype' => 'text', 'size' => 50);
$config[] = array('name' => 'post_spam_sites_conf_file', 'title' => $constpref . '_POST_SPAM_SITES', 'description' => $constpref . '_POST_SPAM_SITES_DESC', 'formtype' => 'textarea', 'valuetype' => 'file:/class/hyp_common/config/spamsites.conf.dat', 'size' => 80);
$_spamsites_dat_file = is_file(XOOPS_TRUST_PATH . '/uploads/hyp_common/spamsites.dat') ? XOOPS_TRUST_PATH . '/uploads/hyp_common/spamsites.dat' : XOOPS_TRUST_PATH . '/class/hyp_common/dat/spamsites.dat';
$config['underContents'] = '<hr />' . sprintf(hypconf_constant($constpref . '_POST_SPAM_SITES_SYSTEM'), $_spamsites_dat_file) . '<p>Updated: ' . date('r', filemtime($_spamsites_dat_file)) . '</p>' . '<form><textarea style="width:98%;height:15em;" readonly="readonly">' . htmlspecialchars(file_get_contents($_spamsites_dat_file), ENT_COMPAT, _CHARSET) . '</textarea></form>';
Example #4
0
    $page = preg_replace('/[^a-zA-Z0-9_-]/', '', @$_GET['page']);
    if (file_exists("{$mytrustdirpath}/admin/{$page}.php")) {
        // load $config
        include "{$mytrustdirpath}/admin/{$page}.php";
        $op = '';
        if (isset($_POST) && isset($_POST['op'])) {
            $op = $_POST['op'];
        }
        if ($op === 'save') {
            hypconfSaveConf($config);
            // send redirect header
            exit;
        } else {
            hypconfSetValue($config, $page);
            // display form
            xoops_cp_header();
            echo '<style type="text/css">' . 'form label {display:inline-block;width:30%;vertical-align:top;margin:5px;}' . 'form td div {max-height:15em;overflow:auto;}' . 'form td.head {white-space:nowrap;vertical-align:middle !important}' . 'form textarea {width:100%;}' . 'form td.odd {padding-left:2em;border-bottom:2px solid;}' . '</style>';
            include dirname(__FILE__) . '/admin/mymenu.php';
            echo '<h3 style="text-align:' . _GLOBAL_LEFT . ';">' . hypconf_constant($constpref . '_DESC') . "</h3>\n";
            hypconfShowForm($config);
            xoops_cp_footer();
            exit;
        }
    } else {
        if (file_exists("{$mytrustdirpath}/admin/index.php")) {
            include "{$mytrustdirpath}/admin/index.php";
        } else {
            die('wrong request');
        }
    }
}
Example #5
0
function hypconfShowForm($config)
{
    global $constpref, $mydirname, $mydirpath, $mytrustdirpath, $page, $xoopsConfig, $xoopsGTicket;
    if (!$config) {
        die('no configs');
    }
    if (isset($config['error'])) {
        echo '<div class="error">' . join('</div><div class="error">', $config['error']) . '</div>';
        unset($config['error']);
    }
    if (isset($config['contents'])) {
        echo $config['contents'];
        unset($config['contents']);
    }
    if ($config) {
        $count = count($config);
        include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
        include_once dirname(dirname(__FILE__)) . '/class/formcheckbox.php';
        if (!XC_CLASS_EXISTS('XoopsFormBreak')) {
            include_once dirname(dirname(__FILE__)) . '/class/formbreak.php';
        }
        $form = new XoopsThemeForm(hypconf_constant($constpref . '_ADMENU_' . strtoupper($page)), 'pref_form', 'index.php');
        $button_tray = new XoopsFormElementTray("");
        for ($i = 0; $i < $count; $i++) {
            $description = defined($config[$i]['description']) ? constant($config[$i]['description']) : '';
            //$title4tray = (!$description) ? hypconf_constant($config[$i]['title']) : hypconf_constant($config[$i]['title']).'<br /><br /><span style="font-weight:normal;">'.hypconf_constant($config[$i]['description']).'</span>'; // GIJ
            $title4tray = hypconf_constant($config[$i]['title']);
            $title = '';
            // GIJ
            switch ($config[$i]['formtype']) {
                case 'textarea':
                    $myts =& MyTextSanitizer::getInstance();
                    if ($config[$i]['valuetype'] == 'array') {
                        // this is exceptional.. only when value type is arrayneed a smarter way for this
                        $ele = $config[$i]['value'] != '' ? new XoopsFormTextArea($title, $config[$i]['name'], $myts->htmlspecialchars(implode('|', $config[$i]['value'])), 5, 50) : new XoopsFormTextArea($title, $config[$i]['name'], '', 5, 50);
                    } else {
                        $ele = new XoopsFormTextArea($title, $config[$i]['name'], $myts->htmlspecialchars($config[$i]['value']), 5, 50);
                        $ele->setExtra('class="norich"');
                    }
                    break;
                case 'select':
                    $size = 1;
                    if (!empty($config[$i]['size'])) {
                        $size = $config[$i]['size'];
                    }
                    $ele = new XoopsFormSelect($title, $config[$i]['name'], $config[$i]['value'], $size);
                    $options = $config[$i]['options'];
                    $opcount = count($options);
                    foreach ($options as $option) {
                        $optval = defined($option['confop_value']) ? constant($option['confop_value']) : $option['confop_value'];
                        $optkey = defined($option['confop_name']) ? constant($option['confop_name']) : $option['confop_name'];
                        $ele->addOption($optval, $optkey);
                    }
                    break;
                case 'select_multi':
                    $size = 5;
                    if (!empty($config[$i]['size'])) {
                        $size = $config[$i]['size'];
                    }
                    $ele = new XoopsFormSelect($title, $config[$i]['name'], $config[$i]['value'], $size, true);
                    $options = $config[$i]['options'];
                    foreach ($options as $option) {
                        $optval = defined($option['confop_value']) ? constant($option['confop_value']) : $option['confop_value'];
                        $optkey = defined($option['confop_name']) ? constant($option['confop_name']) : $option['confop_name'];
                        $ele->addOption($optval, $optkey);
                    }
                    break;
                case 'check':
                    $ele = new HypconfFormCheckBox($title, $config[$i]['name'], $config[$i]['value']);
                    if (!empty($config[$i]['width'])) {
                        //$ele->setWidth($config[$i]['width']);
                    }
                    $options = $config[$i]['options'];
                    foreach ($options as $option) {
                        $optval = defined($option['confop_value']) ? hypconf_constant($option['confop_value']) : $option['confop_value'];
                        $optkey = defined($option['confop_name']) ? hypconf_constant($option['confop_name']) : $option['confop_name'];
                        $ele->addOption($optval, $optkey);
                    }
                    break;
                case 'yesno':
                    $ele = new XoopsFormRadioYN($title, $config[$i]['name'], $config[$i]['value'], _YES, _NO);
                    break;
                case 'password':
                    $size = 50;
                    if (!empty($config[$i]['size'])) {
                        $size = $config[$i]['size'];
                    }
                    $myts =& MyTextSanitizer::getInstance();
                    $ele = new XoopsFormPassword($title, $config[$i]['name'], $size, 255, $myts->htmlspecialchars($config[$i]['value']));
                    break;
                case 'textbox':
                default:
                    $size = 50;
                    if (!empty($config[$i]['size'])) {
                        $size = $config[$i]['size'];
                    }
                    $myts =& MyTextSanitizer::getInstance();
                    $ele = new XoopsFormText($title, $config[$i]['name'], $size, 255, $myts->htmlspecialchars($config[$i]['value']));
                    if ($config[$i]['valuetype'] === 'int') {
                        $ele->setExtra(' style="text-align:right;"');
                    }
                    break;
            }
            $ele_tray = new XoopsFormElementTray($title4tray, '');
            $ele_tray->addElement($ele);
            $form->addElement($ele_tray);
            if ($description) {
                $form->insertBreak('<span style="font-weight:normal;">' . $description . '</span>', 'odd');
            }
            unset($ele_tray);
            unset($ele);
        }
        $button_tray->addElement(new XoopsFormHidden('op', 'save'));
        $button_tray->addElement(new XoopsFormHidden('page', $page));
        $xoopsGTicket->addTicketXoopsFormElement($button_tray, __LINE__, 1800, 'hypconf');
        $button_tray->addElement(new XoopsFormButton('', 'button', _GO, 'submit'));
        $form->addElement($button_tray);
        $form->display();
    }
}
Example #6
0
function hypconfShowForm($config)
{
    global $constpref, $mydirname, $mydirpath, $mytrustdirpath, $page, $xoopsConfig, $xoopsGTicket;
    if (!$config) {
        die('no configs');
    }
    if (isset($config['error'])) {
        echo '<div class="error">' . join('</div><div class="error">', $config['error']) . '</div>';
        unset($config['error']);
    }
    if (isset($config['contents'])) {
        echo $config['contents'];
        unset($config['contents']);
    }
    $underContents = '';
    if (isset($config['underContents'])) {
        $underContents = $config['underContents'];
        unset($config['underContents']);
    }
    if ($config) {
        $count = count($config);
        include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
        include_once dirname(dirname(__FILE__)) . '/class/formcheckbox.php';
        if (!XC_CLASS_EXISTS('XoopsFormBreak')) {
            include_once dirname(dirname(__FILE__)) . '/class/formbreak.php';
        }
        $form = new XoopsThemeForm(hypconf_constant($constpref . '_ADMENU_' . strtoupper($page)), 'pref_form', 'index.php');
        $button_tray = new XoopsFormElementTray("");
        for ($i = 0; $i < $count; $i++) {
            $description = defined($config[$i]['description']) ? constant($config[$i]['description']) : '';
            //$title4tray = (!$description) ? hypconf_constant($config[$i]['title']) : hypconf_constant($config[$i]['title']).'<br /><br /><span style="font-weight:normal;">'.hypconf_constant($config[$i]['description']).'</span>'; // GIJ
            $title4tray = hypconf_constant($config[$i]['title']);
            $title = '';
            // GIJ
            switch ($config[$i]['formtype']) {
                case 'textarea':
                    (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || ($myts =& MyTextSanitizer::getInstance());
                    if ($config[$i]['valuetype'] == 'array') {
                        // this is exceptional.. only when value type is arrayneed a smarter way for this
                        $ele = $config[$i]['value'] != '' ? new XoopsFormTextArea($title, $config[$i]['name'], $myts->htmlspecialchars(implode('|', $config[$i]['value'], _CHARSET)), 5, 50) : new XoopsFormTextArea($title, $config[$i]['name'], '', 5, 50);
                    } else {
                        $ele = new XoopsFormTextArea($title, $config[$i]['name'], $myts->htmlspecialchars($config[$i]['value'], ENT_COMPAT, _CHARSET), 5, 50);
                        $ele->setExtra('class="norich plain" spellcheck="false"');
                    }
                    break;
                case 'select':
                    $size = 1;
                    if (!empty($config[$i]['size'])) {
                        $size = $config[$i]['size'];
                    }
                    $ele = new XoopsFormSelect($title, $config[$i]['name'], $config[$i]['value'], $size);
                    $options = $config[$i]['options'];
                    $opcount = count($options);
                    //var_dump($options);
                    foreach ($options as $option) {
                        if (isset($option['confop_value']) && isset($option['confop_name'])) {
                            $optval = defined($option['confop_value']) ? constant($option['confop_value']) : $option['confop_value'];
                            $optkey = defined($option['confop_name']) ? constant($option['confop_name']) : $option['confop_name'];
                        } else {
                            $optval = $optkey = $option;
                        }
                        $ele->addOption($optval, $optkey);
                    }
                    break;
                case 'select_multi':
                    $size = 5;
                    if (!empty($config[$i]['size'])) {
                        $size = $config[$i]['size'];
                    }
                    $ele = new XoopsFormSelect($title, $config[$i]['name'], $config[$i]['value'], $size, true);
                    $options = $config[$i]['options'];
                    foreach ($options as $option) {
                        $optval = defined($option['confop_value']) ? constant($option['confop_value']) : $option['confop_value'];
                        $optkey = defined($option['confop_name']) ? constant($option['confop_name']) : $option['confop_name'];
                        $ele->addOption($optval, $optkey);
                    }
                    break;
                case 'check':
                    $ele = new HypconfFormCheckBox($title, $config[$i]['name'], $config[$i]['value']);
                    if (!empty($config[$i]['width'])) {
                        //$ele->setWidth($config[$i]['width']);
                    }
                    $options = $config[$i]['options'];
                    foreach ($options as $option) {
                        $optval = defined($option['confop_value']) ? hypconf_constant($option['confop_value']) : $option['confop_value'];
                        $optkey = defined($option['confop_name']) ? hypconf_constant($option['confop_name']) : $option['confop_name'];
                        $ele->addOption($optval, $optkey);
                    }
                    break;
                case 'radio':
                    $ele = new XoopsFormRadio($title, $config[$i]['name'], $config[$i]['value']);
                    if (!empty($config[$i]['width'])) {
                        //$ele->setWidth($config[$i]['width']);
                    }
                    $options = $config[$i]['options'];
                    foreach ($options as $option) {
                        $optval = defined($option['confop_value']) ? hypconf_constant($option['confop_value']) : $option['confop_value'];
                        $optkey = defined($option['confop_name']) ? hypconf_constant($option['confop_name']) : $option['confop_name'];
                        $ele->addOption($optval, $optkey);
                    }
                    break;
                case 'yesno':
                    $ele = new XoopsFormRadioYN($title, $config[$i]['name'], $config[$i]['value'], _YES, _NO);
                    break;
                case 'password':
                    $size = 50;
                    if (!empty($config[$i]['size'])) {
                        $size = $config[$i]['size'];
                    }
                    (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || ($myts =& MyTextSanitizer::getInstance());
                    $ele = new XoopsFormPassword($title, $config[$i]['name'], $size, 255, $myts->htmlspecialchars($config[$i]['value'], ENT_COMPAT, _CHARSET));
                    break;
                case 'label':
                    $ele = new XoopsFormLabel($title, $description);
                    $description = '';
                    break;
                case 'theme':
                case 'theme_multi':
                    $ele = $config[$i]['formtype'] !== 'theme_multi' ? new XoopsFormSelect($title, $config[$i]['name'], $config[$i]['value']) : new XoopsFormSelect($title, $config[$i]['name'], $config[$i]['value'], 5, true);
                    $handle = opendir(XOOPS_THEME_PATH . '/');
                    $dirlist = array();
                    while (false !== ($file = readdir($handle))) {
                        if (is_dir(XOOPS_THEME_PATH . '/' . $file) && !preg_match("/^\\..*\$/", $file) && strtolower($file) != 'cvs') {
                            $dirlist[$file] = $file;
                        }
                    }
                    closedir($handle);
                    $ele->addOption('', hypconf_constant($constpref . '_NOT_SPECIFY'));
                    if (!empty($dirlist)) {
                        asort($dirlist);
                        $ele->addOptionArray($dirlist);
                    }
                    break;
                case 'tplset':
                    $ele = new XoopsFormSelect($title, $config[$i]['name'], $config[$i]['value']);
                    $tplset_handler =& xoops_gethandler('tplset');
                    $tplsetlist =& $tplset_handler->getList();
                    asort($tplsetlist);
                    $ele->addOption('', hypconf_constant($constpref . '_NOT_SPECIFY'));
                    foreach ($tplsetlist as $key => $name) {
                        $ele->addOption($key, htmlspecialchars($name, ENT_QUOTES, _CHARSET));
                    }
                    break;
                case 'textbox':
                default:
                    $size = 50;
                    if (!empty($config[$i]['size'])) {
                        $size = $config[$i]['size'];
                    }
                    (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || ($myts =& MyTextSanitizer::getInstance());
                    $ele = new XoopsFormText($title, $config[$i]['name'], $size, 255, $myts->htmlspecialchars($config[$i]['value'], ENT_COMPAT, _CHARSET));
                    if ($config[$i]['valuetype'] === 'int') {
                        $ele->setExtra(' style="text-align:right;"');
                    }
                    break;
            }
            $ele_tray = new XoopsFormElementTray($title4tray, '');
            $ele_tray->addElement($ele);
            $form->addElement($ele_tray);
            if ($description) {
                $form->insertBreak('<span style="font-weight:normal;">' . $description . '</span>', 'odd');
            }
            unset($ele_tray);
            unset($ele);
        }
        $button_tray->addElement(new XoopsFormHidden('op', 'save'));
        $button_tray->addElement(new XoopsFormHidden('page', $page));
        $xoopsGTicket->addTicketXoopsFormElement($button_tray, __LINE__, 1800, 'hypconf');
        $button_tray->addElement(new XoopsFormButton('', 'button', _GO, 'submit'));
        $form->addElement($button_tray);
        $form->display();
    }
    if ($underContents) {
        echo '<div>' . $underContents . '</div>';
    }
}
Example #7
0
<div style="max-width:700px;">
 <pre style="width:100%;height:25em;overflow:auto;padding:1em;border:1px solid gray">{$data}</pre>
</div>
EOD;
$check_dir = array(XOOPS_ROOT_PATH . '/class/hyp_common/cache', XOOPS_TRUST_PATH . '/cache', XOOPS_TRUST_PATH . '/class/hyp_common/favicon/cache', XOOPS_TRUST_PATH . '/uploads/hyp_common', XOOPS_TRUST_PATH . '/uploads/hyp_common/kakasi');
$dir_res = array();
foreach ($check_dir as $dir) {
    $dir = rtrim($dir, '/');
    if (is_writable($dir)) {
        $dir .= ' (<span style="color:green;font-weight:bold;">OK</span>)';
    } else {
        $dir .= ' (<span style="color:red;font-weight:bold;">NG</span>)';
    }
    $dir_res[] = $dir;
}
$dir_res = '<ul><li>' . join('</li><li>', $dir_res) . '</li></ul>';
// output
xoops_cp_header();
include dirname(__FILE__) . '/mymenu.php';
echo '<h3>' . hypconf_constant($constpref . '_DESC') . ' - ' . hypconf_constant($constpref . '_ADMENU_CONTENTSADMIN') . '</h3>';
echo '<h4>trust' . HYP_COMMON_PRELOAD_CONF . '</h4>';
echo <<<EOD

{$content}

<h3>Writable check results</h3>
{$dir_res}

EOD;
xoops_cp_footer();
exit;