コード例 #1
0
 public static function upload_file($file_name, $ext = '', $isr = 1, $folder = '', $output = 'normal')
 {
     global $_lang, $kekezu;
     if ($_FILES[$file_name]['size']) {
         $ext == '' && ($ext = $kekezu->_sys_config['file_type']);
         if ($folder != '') {
             $absolute_path = S_ROOT . '/data/uploads/sys/' . $folder;
             $filepath = 'data/uploads/sys/' . $folder;
         } else {
             $absolute_path = UPLOAD_ROOT;
             $filepath = 'data/uploads/' . UPLOAD_RULE;
         }
         $upload_obj = new keke_upload_class($absolute_path, explode('|', $ext), UPLOAD_MAXSIZE);
         $files = $upload_obj->run($file_name, $isr);
         if (!empty($files) && is_array($files)) {
             $file = $files[0]['saveName'];
             return $filepath . $file;
         } else {
             $err = $files;
             switch ($output) {
                 case "normal":
                     kekezu::show_msg($_lang['operate_notice'], '', 2, $err, 'warning');
                     break;
                 case "json":
                     echo kekezu::json_encode_k(array('err' => $err));
                     die;
                     break;
             }
         }
     }
 }
コード例 #2
0
<?php

defined('ADMIN_KEKE') or exit('Access Denied');
kekezu::admin_check_role(41);
$nav_list = kekezu::get_table_data('*', 'witkey_nav', '', 'listorder', '', '', "nav_id");
$nav_list_json = kekezu::json_encode_k(kekezu::gbktoutf($nav_list));
$nav_obj = new keke_table_class("witkey_nav");
$url = "index.php?do={$do}&view={$view}";
if ($ac == 'edit') {
    if (!empty($nav_id)) {
        $sql = sprintf("select * from %switkey_nav where nav_id ='%d' limit 0,1", TABLEPRE, $nav_id);
        $nav_config = db_factory::get_one($sql);
        $readonly = nav_analysis($nav_config['nav_url']);
    }
    if ($fds and $sbt_edit) {
        if ($set_index) {
            $set_rs = db_factory::execute(sprintf("update %switkey_basic_config set v='%s' where k='set_index'", TABLEPRE, $fds['nav_style']));
        } else {
            $set_rs = db_factory::execute(sprintf("update %switkey_basic_config set v='index' where k='set_index'", TABLEPRE));
        }
        $res = $nav_obj->save($fds, $pk);
        $res || $set_rs and kekezu::admin_show_msg($_lang['operate_success'], $url, 2, $_lang['edit_success'], "success") or kekezu::admin_show_msg($_lang['operate_fail'], $url, 2, $_lang['edit_fail'], "error");
    }
    require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_config_' . $view . '_edit');
    die;
}
if ($ac == 'del') {
    $nav_obj->del('nav_id', $nav_id, $url);
    kekezu::admin_show_msg($_lang['delete_nav_success'], "index.php?do=config&view=nav", 3, '', 'success');
}
if ($ac == 'set_index') {