本文整理汇总了PHP中Func::categoryTree方法的典型用法代码示例。如果您正苦于以下问题:PHP Func::categoryTree方法的具体用法?PHP Func::categoryTree怎么用?PHP Func::categoryTree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Func
的用法示例。
在下文中一共展示了Func::categoryTree方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* @descrpition 修改
*/
public function edit()
{
if (Request::getRequest('dosubmit', 'str')) {
$jumpUrl = '/admin.php/itemdocmenu/edit/id-' . $this->param['id'];
$fields = array();
$fields['name'] = Request::getRequest('name', 'str');
$fields['pid'] = Request::getRequest('pid', 'str');
$fields['in_out'] = Request::getRequest('in_out', 'str');
$fields['url'] = Request::getRequest('url', 'str');
$fields['item'] = strtolower(Request::getRequest('item', 'item'));
if (empty($fields['name']) || empty($fields['item'])) {
View::showAdminErrorMessage($jumpUrl, '未填写完成');
}
$result = ItemDocMenuBusiness::editMenu($this->param['id'], $fields);
if ($result) {
View::showAdminMessage('/admin.php/itemdocmenu/lists', '修改成功');
} else {
View::showAdminErrorMessage($jumpUrl, '修改失败');
}
}
$menuList = ItemDocMenuBusiness::getMenuList();
$menuList = Func::arrayKey($menuList);
$blogMenuList = Func::categoryTree($menuList);
$blogMenu = ItemDocMenuBusiness::getMenu($this->param['id']);
View::assign('blogMenu', $blogMenu);
View::assign('blogMenuList', $blogMenuList);
View::showAdminTpl('item_doc_menu_edit');
}
示例2: __construct
/**
*
* 构造函数
* @param $param 实例化时传入的参数
*/
public function __construct($param = array())
{
$this->param = $param;
//分类菜单相关
$this->adminMenuObi = new AdminMenuModel();
$this->menuList = $this->adminMenuObi->getList();
$this->menuList = Func::arrayKey($this->menuList);
$this->menuListTree = Func::categoryTree($this->menuList);
View::assign('menuList', $this->menuListTree);
}
示例3: edit
/**
* @descrpition 修改文章
*/
public function edit()
{
if (Request::getRequest('dosubmit', 'str')) {
$jumpUrl = '/admin.php/itemdocarticle/edit/id-' . $this->param['id'];
$fields = array();
$fields['title'] = Request::getRequest('title', 'str');
$fields['seo_title'] = Request::getRequest('seo_title', 'str');
$fields['seo_description'] = Request::getRequest('seo_description', 'str');
$fields['seo_keywords'] = Request::getRequest('seo_keywords', 'str');
$fields['author'] = Request::getRequest('author', 'str');
$fields['clicks'] = Request::getRequest('clicks', 'str');
$fields['tag'] = Request::getRequest('tag', 'str');
$fields['good_num'] = Request::getRequest('good_num', 'str');
$fields['bad_num'] = Request::getRequest('bad_num', 'str');
$fields['ctime'] = Request::getRequest('ctime', 'str');
$fields['ctime'] = strtotime($fields['ctime']);
$fields['mid'] = Request::getRequest('mid', 'int');
$fields['item'] = Request::getRequest('item', 'str');
$fields['content'] = Request::getRequest('content', 'str');
//如果使用UEditor,则反转义一次
$fields['content'] = htmlspecialchars_decode($fields['content']);
//将TAG记录进TAG表
$tags = explode('|', $fields['tag']);
foreach ($tags as $tag) {
if (empty($tag)) {
continue;
}
$tagInfo = ItemDocTagBusiness::getTagByTag($tag);
if (!empty($tagInfo)) {
$tagInfo['num']++;
ItemDocTagBusiness::editTag($tagInfo['id'], $tagInfo);
} else {
$tagFields['tag'] = $tag;
$tagFields['num'] = 1;
ItemDocTagBusiness::setTag($tagFields);
}
}
$result = ItemDocArticleBusiness::editArticle($this->param['id'], $fields);
if ($result) {
View::showAdminMessage('/admin.php/itemdocarticle/lists', '修改成功');
} else {
View::showAdminErrorMessage($jumpUrl, '修改失败');
}
}
$blogMenuList = ItemDocMenuBusiness::getMenuList();
$blogMenuList = Func::arrayKey($blogMenuList);
$blogMenuList = Func::categoryTree($blogMenuList);
$article = ItemDocArticleBusiness::getArticle($this->param['id']);
View::assign('article', $article);
View::assign('blogMenuList', $blogMenuList);
View::showAdminTpl('item_doc_article_edit');
}
示例4: edit
/**
* @descrpition 修改
*/
public function edit()
{
if (Request::getRequest('dosubmit', 'str')) {
$jumpUrl = '/admin.php/menu/edit/id-' . $this->param['id'];
$fields = array();
$fields['name'] = Request::getRequest('name', 'str');
$fields['pid'] = Request::getRequest('pid', 'str');
$fields['in_out'] = Request::getRequest('in_out', 'str');
$fields['seo_title'] = Request::getRequest('seo_title', 'str');
$fields['seo_description'] = Request::getRequest('seo_description', 'str');
$fields['seo_keywords'] = Request::getRequest('seo_keywords', 'str');
$fields['url'] = Request::getRequest('url', 'str');
$fields['item'] = Request::getRequest('url', 'item');
if (empty($fields['name'])) {
View::showAdminErrorMessage($jumpUrl, '未填写完成');
}
$result = MenuBusiness::editMenu($this->param['id'], $fields);
if ($result) {
View::showAdminMessage('/admin.php/menu/lists', '添加成功');
} else {
View::showAdminErrorMessage($jumpUrl, '添加失败');
}
}
$menuList = MenuBusiness::getMenuList();
$menuList = Func::arrayKey($menuList);
$blogMenuList = Func::categoryTree($menuList);
$blogMenu = MenuBusiness::getMenu($this->param['id']);
View::assign('blogMenu', $blogMenu);
View::assign('blogMenuList', $blogMenuList);
View::showAdminTpl('menu_edit');
}