Ejemplo n.º 1
0
$list_status = $page_obj->isNew() ? 1 : $page_obj->getVar('page_status');
$page_blank = $page_obj->isNew() ? 0 : $page_obj->getVar('page_blank');
$title = $page_obj->isNew() ? _AM_ABOUT_PAGE_INSERT : _AM_ABOUT_EDIT;
$form = new XoopsThemeForm($title, 'form', "admin.page.php", 'post', true);
$form->setExtra("enctype=\"multipart/form-data\"");
if ($pageType == 1) {
    $form->addElement(new XoopsFormText(_AM_ABOUT_PAGE_TITLE, 'page_title', 60, 255, $page_obj->getVar('page_title', $format)), true);
    $menu = new XoopsFormElementTray(_AM_ABOUT_PAGE_MENU_LIST);
    $menu->addElement(new XoopsFormRadioYN('', 'page_menu_status', $menu_status));
    $menu->addElement(new XoopsFormText(_AM_ABOUT_PAGE_MENU_TITLE . ':', 'page_menu_title', 30, 255, $page_obj->getVar('page_menu_title', $format)));
    $menu->addElement(new XoopsFormLabel('', _AM_ABOUT_PAGE_LINK_MENU));
    $form->addElement($menu, true);
    $configs = array('editor' => 'fckeditor', 'width' => '100%', 'height' => '500px', 'value' => $page_obj->getVar('page_text'));
    $form->addElement(new XoopsFormEditor(_AM_ABOUT_PAGE_TEXT, 'page_text', $configs), true);
    // Template set
    $templates = about_getTemplateList("page");
    if (count($templates) > 0) {
        $template_select = new XoopsFormSelect(_AM_ABOUT_TEMPLATE_SELECT, "page_tpl", $page_obj->getVar("page_tpl"));
        $template_select->addOptionArray($templates);
        $form->addElement($template_select);
    }
} else {
    $form->addElement(new XoopsFormText(_AM_ABOUT_PAGE_MENU_TITLE . ':', 'page_menu_title', 60, 255, $page_obj->getVar('page_menu_title', $format)));
    $form->addElement(new XoopsFormHidden('page_menu_status', $menu_status));
    $form->addElement(new XoopsFormText(_AM_ABOUT_PAGE_LINK_TEXT, 'page_text', 60, 255, $page_obj->isNew() ? 'http://' . $page_obj->getVar('page_text', $format) : $page_obj->getVar('page_text', $format)), true);
}
$image_tray = new XoopsFormElementTray(_AM_ABOUT_PAGE_IMAGE);
$image_uploader = new XoopsFormFile('', 'userfile', 500000);
$image_tray->addElement($image_uploader);
$page_image = $page_obj->getVar("page_image");
if (!empty($page_image) && file_exists(XOOPS_ROOT_PATH . "/uploads/" . $xoopsModule->dirname() . "/" . $page_image)) {
Ejemplo n.º 2
0
    if (class_exists('XoopsFormEditor')) {
        $options['name'] = 'page_text';
        $options['value'] = $page_obj->getVar('page_text');
        $options['rows'] = 25;
        $options['cols'] = '100%';
        $options['width'] = '100%';
        $options['height'] = '400px';
        $pageEditor = new XoopsFormEditor('', $xoopsModuleConfig['editorAdmin'], $options, $nohtml = false, $onfailure = 'textarea');
        $editorTray->addElement($pageEditor);
    } else {
        $pageEditor = new XoopsFormDhtmlTextArea('', 'page_text', $page_obj->getVar('page_text'), '100%', '100%');
        $editorTray->addElement($pageEditor);
    }
    $form->addElement($editorTray);
    // Template set
    $templates =& about_getTemplateList('page');
    if (count($templates) > 0) {
        $template_select = new XoopsFormSelect(_AM_ABOUT_TEMPLATE_SELECT, 'page_tpl', $page_obj->getVar('page_tpl'));
        $template_select->addOptionArray($templates);
        $form->addElement($template_select);
    }
} else {
    $form->addElement(new XoopsFormText(_AM_ABOUT_PAGE_MENU_TITLE . ':', 'page_menu_title', 60, 255, $page_obj->getVar('page_menu_title', $format)));
    $form->addElement(new XoopsFormHidden('page_menu_status', $menu_status));
    $form->addElement(new XoopsFormText(_AM_ABOUT_PAGE_LINK_TEXT, 'page_text', 60, 255, $page_obj->isNew() ? 'http://' . $page_obj->getVar('page_text', $format) : $page_obj->getVar('page_text', $format)), true);
}
$page_list = $page_handler->getTrees(0, '--');
$page_options = array();
if ($page_list) {
    foreach ($page_list as $id => $page) {
        $page_options[$id] = $page['prefix'] . $page['page_menu_title'];