Пример #1
0
<?php

defined('DT_ADMIN') or exit('Access Denied');
$TYPE = get_type('style', 1);
require MD_ROOT . '/style.class.php';
$do = new style();
$menus = array(array('安装模板', '?moduleid=' . $moduleid . '&file=' . $file . '&action=add'), array('模板列表', '?moduleid=' . $moduleid . '&file=' . $file), array('模板分类', 'javascript:Dwidget(\'?file=type&item=' . $file . '\', \'模板分类\');'));
switch ($action) {
    case 'add':
        if ($submit) {
            if ($do->pass($post)) {
                $do->add($post);
                dmsg('添加成功', '?moduleid=' . $moduleid . '&file=' . $file . '&action=' . $action);
            } else {
                msg($do->errmsg);
            }
        } else {
            $addtime = timetodate($DT_TIME);
            include tpl('style_add', $module);
        }
        break;
    case 'edit':
        $itemid or msg();
        $do->itemid = $itemid;
        if ($submit) {
            if ($do->pass($post)) {
                $do->edit($post);
                dmsg('修改成功', $forward);
            } else {
                msg($do->errmsg);
            }