当前位置: 首页>>代码示例>>PHP>>正文


PHP misc::build_category_select_box方法代码示例

本文整理汇总了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('"', '&quot;', $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> &nbsp;&nbsp; <a href="add-link-category.php">[Add Category]</a> &nbsp;&nbsp; <a href="edit-link-category.php?category_id=' . $cat_id . '">[Edit]</a> &nbsp;&nbsp; <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 = '&nbsp;<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();
开发者ID:vijo,项目名称:Blue-Smiley-Organizer,代码行数:31,代码来源:add-link-category.php


注:本文中的misc::build_category_select_box方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。