本文整理汇总了PHP中misc::build_category_select_box方法的典型用法代码示例。如果您正苦于以下问题:PHP misc::build_category_select_box方法的具体用法?PHP misc::build_category_select_box怎么用?PHP misc::build_category_select_box使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类misc
的用法示例。
在下文中一共展示了misc::build_category_select_box方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: trim
$title = $_POST['title'];
if (!$title) {
$error .= '<li> Category cannot be left blank';
} else {
$title = trim($title);
if (strlen($title) > 50) {
$error .= '<li> Title is too long (Max. 50 Characters)';
}
$title = str_replace('"', '"', $title);
}
if (!$error) {
$base_instance->query('INSERT INTO ' . $base_instance->entity['LINK']['CATEGORY'] . ' (title,user,parent_id) VALUES ("' . sql_safe($title) . '",' . $userid . ',' . $category_id . ')');
$cat_id = mysqli_insert_id($base_instance->db_link);
$base_instance->show_message('Link Category saved', '<a href="add-link.php?category_id=' . $cat_id . '">[Add Link]</a> <a href="add-link-category.php">[Add Category]</a> <a href="edit-link-category.php?category_id=' . $cat_id . '">[Edit]</a> <a href="javascript:void(window.open(\'delete-link-category.php?category_id=' . $cat_id . '\',\'\',\'width=450,height=200,top=100,left=100\'))">[Delete]</a><p><a href="show-link-categories.php">[Show Link Categories]</a>');
} else {
$html_instance->error_message = $error;
$title = stripslashes($title);
}
}
$select_box = ' <select name="category_id">';
if (empty($category_id)) {
$select_box .= "<option selected value=0>-- MAIN CATEGORY --";
} else {
$select_box .= '<option value=0>-- MAIN CATEGORY --';
}
$select_box .= $misc_instance->build_category_select_box(0, $userid, 0, $category_id);
$select_box .= '</select>';
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'New Link Category', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BODY' => 'onLoad="javascript:document.form1.title.focus()"', 'INNER_TABLE_WIDTH' => '400', 'TD_WIDTH' => '30%', 'BUTTON_TEXT' => 'Save Category'));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'title', 'VALUE' => '', 'SIZE' => 35, 'TEXT' => 'Title'));
$html_instance->add_form_field(array('TYPE' => 'label', 'TEXT1' => 'Subcategory of', 'TEXT2' => "{$select_box}", 'SECTIONS' => 2));
$html_instance->process();