示例#1
0
}
// include common language files
global $xoopsConfig;
$common_lang_file = SMARTSECTION_ROOT_PATH . "language/" . $xoopsConfig['language'] . "/common.php";
if (!file_exists($common_lang_file)) {
    $common_lang_file = SMARTSECTION_ROOT_PATH . "language/english/common.php";
}
include_once $common_lang_file;
// include smartobject framework
if (!file_exists(XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php')) {
    trigger_error('SmartObject Framework not found.', E_USER_ERROR);
}
include_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php';
include_once SMARTSECTION_ROOT_PATH . "include/functions.php";
// Check XOOPS version to see if we are on XOOPS 2.2.x plateform
$xoops22 = smartsection_isXoops22();
include_once SMARTSECTION_ROOT_PATH . "include/seo_functions.php";
include_once SMARTSECTION_ROOT_PATH . "class/keyhighlighter.class.php";
// Creating the SmartModule object
$smartModule =& smartsection_getModuleInfo();
// Find if the user is admin of the module
$smartsection_isAdmin = smartsection_userIsAdmin();
$smartsection_moduleName = $smartModule->getVar('name');
// Creating the SmartModule config Object
$smartConfig =& smartsection_getModuleConfig();
include_once SMARTSECTION_ROOT_PATH . "class/smartmetagen.php";
include_once SMARTSECTION_ROOT_PATH . "class/permission.php";
include_once SMARTSECTION_ROOT_PATH . "class/category.php";
include_once SMARTSECTION_ROOT_PATH . "class/item.php";
include_once SMARTSECTION_ROOT_PATH . "class/file.php";
include_once SMARTSECTION_ROOT_PATH . "class/session.php";
示例#2
0
function smartsection_getEditor($caption, $name, $value, $dhtml = true)
{
    $smartConfig =& smartsection_getModuleConfig();
    global $xoops22;
    if (!isset($xoops22)) {
        $xoops22 = smartsection_isXoops22();
    }
    $editor_configs = array();
    $editor_configs["name"] = $name;
    $editor_configs["value"] = $value;
    $editor_configs['caption'] = $caption;
    $editor_configs["rows"] = 35;
    $editor_configs["cols"] = 60;
    $editor_configs["width"] = "100%";
    $editor_configs["height"] = "400px";
    switch ($smartConfig['use_wysiwyg']) {
        case 'tiny':
            if (!$xoops22) {
                if (is_readable(XOOPS_ROOT_PATH . "/class/xoopseditor/tinyeditor/formtinyeditortextarea.php")) {
                    include_once XOOPS_ROOT_PATH . "/class/xoopseditor/tinyeditor/formtinyeditortextarea.php";
                    $editor = new XoopsFormTinyeditorTextArea(array('caption' => $caption, 'name' => $name, 'value' => $value, 'width' => '100%', 'height' => '400px'));
                } else {
                    if ($dhtml) {
                        $editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
                    } else {
                        $editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
                    }
                }
            } else {
                $editor = new XoopsFormEditor($caption, "tinyeditor", $editor_configs);
            }
            break;
        case 'inbetween':
            if (!$xoops22) {
                if (is_readable(XOOPS_ROOT_PATH . "/class/xoopseditor/inbetween/forminbetweentextarea.php")) {
                    include_once XOOPS_ROOT_PATH . "/class/xoopseditor/inbetween/forminbetweentextarea.php";
                    $editor = new XoopsFormInbetweenTextArea(array('caption' => $caption, 'name' => $name, 'value' => $value, 'width' => '100%', 'height' => '300px'), true);
                } else {
                    if ($dhtml) {
                        $editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
                    } else {
                        $editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
                    }
                }
            } else {
                $editor = new XoopsFormEditor($caption, "inbetween", $editor_configs);
            }
            break;
        case 'fckeditor':
            if (!$xoops22) {
                if (is_readable(XOOPS_ROOT_PATH . "/class/xoopseditor/fckeditor/formfckeditor.php")) {
                    include_once XOOPS_ROOT_PATH . "/class/xoopseditor/fckeditor/formfckeditor.php";
                    $editor = new XoopsFormFckeditor($editor_configs, true);
                } else {
                    if ($dhtml) {
                        $editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
                    } else {
                        $editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
                    }
                }
            } else {
                $editor = new XoopsFormEditor($caption, "fckeditor", $editor_configs);
            }
            break;
        case 'koivi':
            if (!$xoops22) {
                if (is_readable(XOOPS_ROOT_PATH . "/class/wysiwyg/formwysiwygtextarea.php")) {
                    include_once XOOPS_ROOT_PATH . "/class/wysiwyg/formwysiwygtextarea.php";
                    $editor = new XoopsFormWysiwygTextArea($caption, $name, $value, '100%', '400px');
                } else {
                    if ($dhtml) {
                        $editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
                    } else {
                        $editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
                    }
                }
            } else {
                $editor = new XoopsFormEditor($caption, "koivi", $editor_configs);
            }
            break;
        case "spaw":
            if (!$xoops22) {
                if (is_readable(XOOPS_ROOT_PATH . "/class/spaw/formspaw.php")) {
                    include_once XOOPS_ROOT_PATH . "/class/spaw/formspaw.php";
                    $editor = new XoopsFormSpaw($caption, $name, $value);
                } else {
                    if ($dhtml) {
                        $editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
                    } else {
                        $editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
                    }
                }
            } else {
                $editor = new XoopsFormEditor($caption, "spaw", $editor_configs);
            }
            break;
        case "htmlarea":
            if (!$xoops22) {
                if (is_readable(XOOPS_ROOT_PATH . "/class/htmlarea/formhtmlarea.php")) {
                    include_once XOOPS_ROOT_PATH . "/class/htmlarea/formhtmlarea.php";
                    $editor = new XoopsFormHtmlarea($caption, $name, $value);
                } else {
                    if ($dhtml) {
                        $editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
                    } else {
                        $editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
                    }
                }
            } else {
                $editor = new XoopsFormEditor($caption, "htmlarea", $editor_configs);
            }
            break;
        default:
            if ($dhtml) {
                $editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 20, 60);
            } else {
                $editor = new XoopsFormTextArea($caption, $name, $value, 7, 60);
            }
            break;
    }
    return $editor;
}