Example #1
0
$pagepower = 'downloads_class';
$moduleRoot = WEB_MODULE . 'downloads/';
//基本部分
require WEB_INC . WEB_APP . 'controller/' . 'checkpower.inc.php';
//功能部分
include $moduleRoot . 'model/' . 'downloads.class.php';
include $moduleRoot . 'model/' . 'downloads_class.class.php';
$downloads = new Downloads();
$downloads_class = new Downloads_class();
require_once WEB_INC . 'uclass.class.php';
$CL = new Uclass();
switch ($a) {
    case 'list':
    default:
        //list
        $List = $downloads_class->GetList(array('id', 'rootid', 'title', 'parentid'));
        $List = $CL->arraySet($List, 0);
        if (is_file(WEB_TPL . 'downloads_class_list.tpl.php')) {
            $templatefile = 'downloads_class_list.tpl.php';
        } else {
            $tpl_in_module = 1;
            $templatefile = $moduleRoot . WEB_APP . 'templates/' . 'downloads_class_list.tpl.php';
        }
        break;
    case 'edit':
        //
        if (isset($submit)) {
            $info = array();
            $time = time();
            if (isset($id)) {
                $id = intval($id);
Example #2
0
     } else {
         $info = array();
         $time = time();
         if (isset($id)) {
             $id = intval($id);
             if ($id <= 0) {
                 errorinfo('变量错误', '');
             }
             $info = $downloads->GetInfo('', ' id = ' . $id);
             if (empty($info)) {
                 errorinfo('变量错误', '');
             }
             //20120719
             checkClassPower('downloads', $info['classid']);
         }
         $classList = $downloads_class->GetList();
         $classList = $CL->arraySet($classList, 0);
         if (is_file(WEB_TPL . 'downloads_edit.tpl.php')) {
             $templatefile = 'downloads_edit.tpl.php';
         } else {
             $tpl_in_module = 1;
             $templatefile = $moduleRoot . WEB_APP . 'templates/' . 'downloads_edit.tpl.php';
         }
     }
     break;
 case 'search':
     //
     break;
 case 'show':
     //
     break;