<?php
# CmsEasy Enterprise Content Management System
# Copyright (C) CmsEasy Co.,Ltd (https://www.CmsEasy.cn). All rights reserved.
if (!defined('ROOT')) exit('Can\'t Access !');

class table_tag extends table_mode {
    function add_before(act $act = NULL) {
        //front::$post['adddate']=date('Y-m-d H:i:s');
    }

    function save_after($tagname = '')
    {
        $tag_data = tag::getInstance()->getrow($tagname);
        //保存之后 自动生成
        cache_make::get_make_tag($tag_data['tagid'],false);
    }

    function delete_before($tagname = '')
    {
        if (config::get("cache_make_open")){
            $tag_data = tag::getInstance()->getrow($tagname);
            $cache_path = tag::url($tag_data['tagname'],front::$get['page'] > 1 ? front::$get['page'] : 1,lang::getisadmin(),false);
            $cache_path = tag::url_rule($cache_path);
            $cache_path=dirname($cache_path);
            if ($cache_path!=ROOT){
                front::remove($cache_path);
            }
        }

    }

}
# This program is an open source system, commercial use, please consciously to purchase commercial license.
# Copyright (C) CmsEasy Co., Ltd. (https://www.CmsEasy.cn). All rights reserved.