$cat_options[$id] = $cat["prefix"] . $cat["cat_title"]; } $cat_select = new XoopsFormSelect(art_constant("MD_PARENT_CATEGORY"), "cat_pid", $category_obj->getVar("cat_pid")); $cat_select->addOptionArray($cat_options); $form_art->addElement($cat_select); } else { $form_art->addElement(new XoopsFormHidden("cat_pid", $category_obj->getVar("cat_pid"))); } // Order $order_input = new XoopsFormText(art_constant("MD_ORDER"), "cat_order", 20, 20, $category_obj->getVar("cat_order")); if (!art_isAdministrator()) { $order_input->setExtra("type=\"disabled\""); } $form_art->addElement($order_input); // Template set $templates =& art_getTemplateList("category"); if (count($templates) > 0) { //$template_option_tray = new XoopsFormElementTray(art_constant("MD_TEMPLATE_SELECT"), "<br />"); $template_select = new XoopsFormSelect(art_constant("MD_TEMPLATE_SELECT"), "cat_template", $category_obj->getVar("cat_template")); $template_select->addOptionArray($templates); //$template_option_tray->addElement($template_select); //$form_art->addElement($template_option_tray); $form_art->addElement($template_select); } // Image if (!empty($xoopsModuleConfig["path_image"])) { $cat_image = $category_obj->getVar("cat_image"); $image_option_tray = new XoopsFormElementTray(art_constant("MD_IMAGE_UPLOAD"), "<br />"); $image_option_tray->addElement(new XoopsFormFile("", "userfile", "")); $form_art->addElement($image_option_tray); unset($image_tray);
$category_handler =& xoops_getmodulehandler("category", $GLOBALS["artdirname"]); $tags = array("cat_id", "cat_pid", "cat_title", "cat_order"); $categories = $category_handler->getAllByPermission("moderate", $tags); $mytree = new artTree($categories, "cat_id"); $box = $mytree->makeSelBox("cat_id", "--", $topic_obj->getVar("cat_id")); $form_art->addElement(new XoopsFormLabel(art_constant("MD_CATEGORY"), $box)); } else { $form_art->addElement(new XoopsFormHidden("cat_id", $topic_obj->getVar("cat_id"))); } // Order $form_art->addElement(new XoopsFormText(art_constant("MD_ORDER"), "top_order", 20, 20, $topic_obj->getVar("top_order"))); // expire $top_expire = $topic_obj->isNew() ? (empty($xoopsModuleConfig["topic_expire"]) ? 365 : $xoopsModuleConfig["topic_expire"]) * 3600 * 24 + time() : $topic_obj->getVar("top_expire"); $form_art->addElement(new XoopsFormDateTime(art_constant("MD_EXPIRATION"), "top_expire", 15, intval($top_expire))); // Template set $templates =& art_getTemplateList("topic"); if (count($templates) > 0) { $template_option_tray = new XoopsFormElementTray(art_constant("MD_TEMPLATE_SELECT"), "<br />"); $template_select = new XoopsFormSelect("", "top_template", $topic_obj->getVar("top_template")); $template_select->addOptionArray($templates); $template_option_tray->addElement($template_select); $form_art->addElement($template_option_tray); } // Sponsor links $form_art->addElement(new XoopsFormTextArea(art_constant("MD_SPONSOR"), "top_sponsor", $topic_obj->getVar("top_sponsor", "e"))); //$form_art->addElement(new XoopsFormLabel(art_constant("MD_SPONSOR_DESC"), art_constant("MD_SPONSOR_DESC_TEXT"))); $form_art->addElement(new XoopsFormHidden("top_id", $topic_obj->getVar("top_id"))); $form_art->addElement(new XoopsFormHidden("from", $from)); $button_tray = new XoopsFormElementTray("", ""); $button_tray->addElement(new XoopsFormButton("", "submit", _SUBMIT, "submit")); $cancel_button = new XoopsFormButton('', 'cancel', _CANCEL, 'button');
$image_tray->addElement(new XoopsFormText(art_constant("MD_IMAGE_CAPTION"), "art_image_caption", 50, 255, @$art_image["caption"])); //$form_element["active"]["art_image_hidden"] = array(); if ($canupload) { $image_option_tray = new XoopsFormElementTray(art_constant("MD_IMAGE_UPLOAD"), "<br />"); $image_option_tray->addElement(new XoopsFormFile("", "userfile", "")); if (!empty($art_image_file_tmp)) { $image_option_tray->addElement(new XoopsFormLabel("", "<a href=\"" . XOOPS_URL . "/" . $xoopsModuleConfig["path_image"] . "/{.{$art_image_file_tmp}}\" rel=\"external\">" . art_constant("MD_IMAGE_UPLOADED") . "</a>")); $form_element["active"]["art_image"][] = new XoopsFormHidden("art_image_file_tmp", $art_image_file_tmp); } $image_tray->addElement($image_option_tray); } $form_element["active"]["art_image"][] = $image_tray; $form_element["inactive"]["art_image"] = null; // Template set include_once dirname(__FILE__) . "/functions.render.php"; if ($templates = art_getTemplateList("article")) { $template_option_tray = new XoopsFormElementTray(art_constant("MD_TEMPLATE_SELECT"), "<br />"); $template_select = new XoopsFormSelect("", "art_template", $art_template); $template_select->addOptionArray($templates); $template_option_tray->addElement($template_select); $form_element["active"]["art_template"] = $template_option_tray; } else { //$form_element["active"]["art_template"] = null; } $form_element["inactive"]["art_template"] = new XoopsFormHidden("art_template", $art_template); // Category // Only author and administrators have the right to change categories // Moderator has the right to remove the article from his category $categories =& $category_handler->getTree(0, "submit", "----"); $cat_options = array(); $top_categories = array();
$do_urw = true; if ($isModuleAction) { $do_urw = in_array(php_sapi_name(), array("apache", "apache2handler")); } $modversion["config"][] = array("name" => "do_urw", "title" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_DOURLREWRITE", "description" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_DOURLREWRITE_DESC", "formtype" => "yesno", "valuetype" => "int", "default" => $do_urw, "category" => "module"); $theme_set = array(_NONE => "0"); if ($isModuleAction) { foreach ($GLOBALS["xoopsConfig"]["theme_set_allowed"] as $theme) { $theme_set[$theme] = $theme; } } $modversion["config"][] = array("name" => "theme_set", "title" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_THEMESET", "description" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_THEMESET_DESC", "formtype" => "select", "valuetype" => "text", "options" => $theme_set, "default" => "", "category" => "module"); $templates = array("default"); if ($isModuleAction) { include_once dirname(__FILE__) . "/include/functions.render.php"; $templates = art_getTemplateList(); } $modversion["config"][] = array("name" => "template", "title" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_TEMPLATE", "description" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_TEMPLATE_DESC", "formtype" => "select", "valuetype" => "text", "options" => $templates, "default" => "default", "category" => "module"); $modversion["config"][] = array("name" => "timeformat", "title" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_TIMEFORMAT", "description" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_TIMEFORMAT_DESC", "formtype" => "textbox", "valuetype" => "text", "default" => "c", "category" => "module"); $modversion["config"][] = array("name" => "do_spotlight", "title" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_DOSPOTLIGHT", "description" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_DOSPOTLIGHT_DESC", "formtype" => "yesno", "valuetype" => "int", "default" => 1, "category" => "module"); $modversion["config"][] = array("name" => "display_summary", "title" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_DISPLAY_SUMMARY", "description" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_DISPLAY_SUMMARY_DESC", "formtype" => "yesno", "valuetype" => "int", "default" => 1, "category" => "module"); $modversion["config"][] = array("name" => "do_rssutf8", "title" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_DORSSUTF8", "description" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_DORSSUTF8_DESC", "formtype" => "yesno", "valuetype" => "int", "default" => 1, "category" => "module"); $modversion["config"][] = array("name" => "articles_perpage", "title" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_ARTICLESPERPAGE", "description" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_ARTICLESPERPAGE_DESC", "formtype" => "textbox", "valuetype" => "int", "default" => 10, "category" => "module"); $modversion["config"][] = array("name" => "articles_index", "title" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_ARTICLES_INDEX", "description" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_ARTICLESINDEX_DESC", "formtype" => "textbox", "valuetype" => "int", "default" => 4, "category" => "module"); $modversion["config"][] = array("name" => "featured_index", "title" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_FEATURED_INDEX", "description" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_FEATUREDINDEX_DESC", "formtype" => "textbox", "valuetype" => "int", "default" => 5, "category" => "module"); $modversion["config"][] = array("name" => "articles_category", "title" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_ARTICLES_CATEGORY", "description" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_ARTICLES_CATEGORY_DESC", "formtype" => "textbox", "valuetype" => "int", "default" => 5, "category" => "module"); $modversion["config"][] = array("name" => "featured_category", "title" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_FEATURED_CATEGORY", "description" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_FEATUREDCATEGORY_DESC", "formtype" => "textbox", "valuetype" => "int", "default" => 5, "category" => "module"); $modversion["config"][] = array("name" => "topics_max", "title" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_TOPIC_MAX", "description" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_TOPIC_MAX_DESC", "formtype" => "textbox", "valuetype" => "int", "default" => 10, "category" => "module"); $modversion["config"][] = array("name" => "topic_expire", "title" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_TOPIC_EXPIRE", "description" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_TOPIC_EXPIRE_DESC", "formtype" => "textbox", "valuetype" => "int", "default" => 0, "category" => "module"); // For artcile uploaded files: image, attachment, html ... $modversion["config"][] = array("name" => "path_file", "title" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_PATHFILE", "description" => $GLOBALS["ART_VAR_PREFIXU"] . "_MI_PATHFILE_DESC", "formtype" => "textbox", "valuetype" => "text", "default" => "uploads/" . $GLOBALS["artdirname"] . "/file", "category" => "module");