文档中心

iCMS文档

二次开发

应用基础知识-应用分类开发

后台链接

admincp.php?app=应用唯一标识_category
示例:文章栏目管理
admincp.php?app=article_category

应用菜单配置

{"caption":"栏目管理","href":"应用唯一标识_category","icon":"list-alt"},
{"caption":"添加栏目","href":"应用唯一标识_category&do=add","icon":"edit"},

应用唯一标识可以使用 {app} 代替

示例1:

{"caption":"栏目管理","href":"article_category","icon":"list-alt"},
{"caption":"添加栏目","href":"article_category&do=add","icon":"edit"},

示例2:

{"caption":"分类管理","href":"{app}_category","icon":"list-alt"},
{"caption":"添加分类","href":"{app}_category&do=add","icon":"edit"},

代码

文件名:应用唯一标识_category.admincp.php
示例:article_category.admincp.php

参考article_category.admincp.php

<?php
/**
* iCMS - i Content Management System
* Copyright (c) 2007-2018 iCMSdev.com. All rights reserved.
*
* @author icmsdev <master@icmsdev.com>
* @site https://www.icmsdev.com
* @licence https://www.icmsdev.com/LICENSE.html
*/
defined('iPHP') OR exit('What are you doing?');

class article_categoryAdmincp extends categoryAdmincp {
    public function __construct() {
        //初始化 传入 iCMS_APP_ARTICLE 文章应用ID
        parent::__construct(iCMS_APP_ARTICLE,'category');
        //配置
        //页面显示名称
        $this->category_name            = "栏目";
        //文章应用标识
        $this->_app                     = 'article';
        //应用名称
        $this->_app_name                = '文章';
        //应用主表
        $this->_app_table               = 'article';
        //应用栏目字段
        $this->_app_cid                 = 'cid';
        /**
         *  默认模板配置
         */
        $this->category_template+=array(
            //'应用标识' => array('名称','模板'),
            'article' => array('文章','{iTPL}/article.htm'),
            'tag'     => array('标签','{iTPL}/tag.htm'),
        );

        /**
         *  默认URL规则配置
         */
        $this->category_rule+= array(
            //'应用标识' => array('名称','规则','伪静态提示'),
            'article' => array('文章','/{CDIR}/{YYYY}/{MM}{DD}/{ID}{EXT}','{ID},{0xID},{LINK}'),
            'tag'     => array('标签','/{CDIR}/t-{TKEY}{EXT}','{ID},{0xID},{TKEY},{NAME},{ZH_CN}')
        );
        /**
         *  URL规则选项
         */
        $this->category_rule_list+= array(
            //'应用标识' => array(
            //array('----'),//分隔符
            //array('选项','名称'),//分隔符
            //),
            'article' => array(
                array('----'),
                array('{ID}','文章ID'),
                array('{0xID}','8位ID'),
                array('{LINK}','自定义链接'),
                array('{0x3ID}','8位ID(前3位)',false),
                array('{0x3,2ID}','8位ID',false),
                array('{TITLE}','文章标题',false),
            ),
            'tag' => array(
                array('----'),
                array('{ID}','标签ID'),
                array('{0xID}','8位ID'),
                array('{TKEY}','标签标识'),
                array('{ZH_CN}','标签名(中文)'),
                array('{NAME}','标签名'),
                array('----'),
                array('{TCID}','分类ID',false),
                array('{TCDIR}','分类目录',false),
            ),
        );
    }
}
?>

评论

暂无评论...
验证码 换一张
取 消