/** * 类目选择 * @param string $file 栏目缓存文件名 * @param intval/array $catid 选中的ID,多选是可以是数组 * @param string $str 属性 * @param string $default_option 默认选项 */ public static function taxonomy($terms = '', $taxonomy = 'category', $catid = 0, $default_option = array()) { if (is_numeric($catid)) { $catid = array($catid); } $tree = new Tree(); $tree->init($terms); $string = '<ul id="' . $taxonomy . 'checklist" class="' . $taxonomy . 'checklist">'; $string .= $tree->get_taxonomy_tree(0, $catid); $string .= '</select>'; return $string; }