예제 #1
0
* @version 1.1.2
* @time 20111004
*/
//初始化
$pagetitle = '下载分类编辑';
$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':
        //
예제 #2
0
        $time = time();
        if (isset($userid)) {
            $userid = intval($userid);
            if ($userid <= 0) {
                errorinfo('变量错误', '');
            }
            $userinfo = $users->GetInfo('', ' id = ' . $userid);
            if (empty($userinfo)) {
                errorinfo('变量错误', '');
            }
        }
        $info = array();
        $info = $users_classpower->GetInfo('', " userid = " . $userid . " and modulename = '" . $modulename . "' ");
        if (!empty($info)) {
            if (isset($info['classpower'])) {
                $power = array();
                $power = explode(",", $info['classpower']);
                foreach ($power as $key => $value) {
                    $power_list[$value] = true;
                }
            }
        }
        $theModuleClass = '' . ucfirst($modulename . '_class');
        $theModule = new $theModuleClass();
        require_once WEB_INC . 'uclass.class.php';
        $CL = new Uclass();
        $List = $theModule->GetList();
        $List = $CL->arraySet($List, 0);
        $templatefile = 'users_classpower.tpl.php';
        break;
}