category.inc.php

来自「Phpcms2008 是一款基于 PHP+Mysql 架构的网站内容管理系统」· PHP 代码 · 共 46 行

PHP
46
字号
<?php
defined('IN_PHPCMS') or exit('Access Denied');
require_once 'tree.class.php';
require_once 'admin/category.class.php';

$tree = new tree;
$catid = isset($catid) ? intval($catid) : 0;
$cat = new category($mod);

$submenu = array
(
	array($LANG['add_category'], '?mod='.$mod.'&file='.$file.'&action=add'),
	array('绠$悊鏍忕洰', '?mod='.$mod.'&file='.$file.'&action=manage'),
	array($LANG['join_category'], '?mod='.$mod.'&file='.$file.'&action=join'),
	array($LANG['update_category_cache'], '?mod='.$mod.'&file='.$file.'&action=updatecache'),
	array($LANG['category_data_repair'], '?mod='.$mod.'&file='.$file.'&action=repair')
);
$menu = admin_menu('绠$悊鏍忕洰', $submenu);

$action = $action ? $action : 'manage';

switch($action)
{
	case 'add':

		if($dosubmit)
		{
		    if(!$category['catname']) showmessage($LANG['category_name_not_null']);

			$catid = $cat->add($category, $setting);
			$priv_group->update('catid', $catid, $priv_groupid);
			$priv_role->update('catid', $catid, $priv_roleid);
			cache_common();
	        showmessage($LANG['operation_success'], '?mod='.$mod.'&file='.$file.'&action=updatecache&catid='.$catid.'&forward='.urlencode($forward));
		}
		else
	    {
			$groups = cache_read('member_group.php');
		    include admin_tpl('category_add');
		}
		break;

	case 'edit':
		$catid = intval($catid);
		if(!$catid) showmessage($LANG['illegal_parameters']);
		if($catid == $category['parentid']) showmessage('褰撳墠鏍忕洰涓嶈兘涓庝笂绾ф爮鐩

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?