function smartsection_items_tree_edit($options) { global $xoopsDB, $xoopsModule, $xoopsUser; include_once XOOPS_ROOT_PATH . "/modules/smartsection/include/functions.php"; include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; $form = "" . _MB_SSECTION_SELECTCAT . " \n<select name='options[]'>\n"; $sel = ""; if ($options[0] == -1) { $sel = " selected='selected'"; } $form .= "<option value='-1'{$sel}>" . _MB_SSECTION_CURRENTCATEGORY . "</option>\n"; if ($options[0] == 0) { $sel = " selected='selected'"; } $form .= "<option value='0'{$sel}>" . _MB_SSECTION_ALLCAT . "</option>\n"; // Creating the category handler object $category_handler =& smartsection_gethandler('category'); // Creating category objects $categoriesObj = $category_handler->getCategories(0, 0, 0); if (count($categoriesObj) > 0) { foreach ($categoriesObj as $catID => $categoryObj) { $form .= smartsection_addCategoryOption($categoryObj, $options[0]); } } $form .= "</select>\n"; $form .= " <br>" . _MB_SSECTION_ORDER . " <select name='options[]'>"; $form .= "<option value='datesub'"; if ($options[1] == "datesub") { $form .= " selected='selected'"; } $form .= ">" . _MB_SSECTION_DATE . "</option>\n"; $form .= "<option value='counter'"; if ($options[1] == "counter") { $form .= " selected='selected'"; } $form .= ">" . _MB_SSECTION_HITS . "</option>\n"; $form .= "<option value='weight'"; if ($options[1] == "weight") { $form .= " selected='selected'"; } $form .= ">" . _MB_SSECTION_WEIGHT . "</option>\n"; $form .= "</select>\n"; $form .= " " . "<select name='options[]'>" . "<option value='ASC'"; if ($options[2] == "ASC") { $form .= " selected='selected'"; } $form .= ">" . _MB_SSECTION_ASC . "</option>" . "<option value='DESC'"; if ($options[2] == "DESC") { $form .= " selected='selected'"; } $form .= ">" . _MB_SSECTION_DESC . "</option>" . "</select>"; $form .= "<br />" . _MB_SSECTION_LEVELS . "<input name='options[]' value='" . $options[3] . "' size='3' maxlenght='3'/>"; $showItemsRadio = new XoopsFormRadioYN(_MB_SSECTION_SHOWITEMS, 'options[]', $options[4]); $form .= "<br />" . _MB_SSECTION_SHOWITEMS . " " . $showItemsRadio->render(); return $form; }
function smartsection_createCategorySelect($selectedid = 0, $parentcategory = 0, $allCatOption = true, $selectname = 'options[0]') { $selectedid = explode(',', $selectedid); $ret = "<select name='" . $selectname . "[]' multiple='multiple' size='10'>"; if ($allCatOption) { $ret .= "<option value='0'"; if (in_array(0, $selectedid)) { $ret .= " selected='selected'"; } $ret .= ">" . _MB_SSECTION_ALLCAT . "</option>"; } // Creating the category handler object $category_handler =& smartsection_gethandler('category'); // Creating category objects $categoriesObj = $category_handler->getCategories(0, 0, $parentcategory); if (count($categoriesObj) > 0) { foreach ($categoriesObj as $catID => $categoryObj) { $ret .= smartsection_addCategoryOption($categoryObj, $selectedid); } } $ret .= "</select>"; return $ret; }