parent
07b7bee252
commit
6a42e3f339
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
if(!function_exists('get_client_ip')){
|
||||
require_once(dirname(dirname(__FILE__)).'/function/web.function.php');
|
||||
}
|
||||
class SSO{
|
||||
static private function init(){
|
||||
$sessionName = 'KOD_SESSION_SSO';
|
||||
$sessionID = $_COOKIE[$sessionName]?$_COOKIE[$sessionName]:md5(uniqid());
|
||||
$basicPath = dirname(dirname(dirname(__FILE__))).'/';
|
||||
$sessionPath = $basicPath.'data/session/';
|
||||
if(file_exists($basicPath.'config/define.php')){
|
||||
include($basicPath.'config/define.php');
|
||||
$sessionPath = DATA_PATH.'session/';
|
||||
}
|
||||
if(!file_exists($sessionPath)){
|
||||
mkdir($sessionPath);
|
||||
}
|
||||
$sessionSavePath = @session_save_path();
|
||||
@session_write_close();
|
||||
@session_name($sessionName);
|
||||
if( class_exists('SaeStorage') ||
|
||||
defined('SAE_APPNAME') ||
|
||||
defined('SESSION_PATH_DEFAULT') ||
|
||||
@ini_get('session.save_handler') != 'files' ||
|
||||
isset($_SERVER['HTTP_APPNAME']) ){
|
||||
//sae 关闭自定义session路径
|
||||
}else{
|
||||
@session_save_path($sessionPath);//session path
|
||||
}
|
||||
@session_id($sessionID);
|
||||
|
||||
@session_start();
|
||||
$_SESSION['kodSSO'] = true;
|
||||
@session_write_close();
|
||||
unset($_SESSION);
|
||||
@session_start();
|
||||
if(!isset($_SESSION['kodSSO']) || !$_SESSION['kodSSO']){
|
||||
@session_save_path($sessionSavePath);//session path
|
||||
@session_start();
|
||||
$_SESSION['kodSSO'] = true;
|
||||
@session_write_close();
|
||||
}
|
||||
//echo '<pre>';var_dump($_SESSION);echo '</pre>';exit;
|
||||
return $_SESSION;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置session 认证
|
||||
* @param [type] $key [认证key]
|
||||
*/
|
||||
static public function sessionSet($key,$value='success'){
|
||||
self::init();
|
||||
@session_start();
|
||||
$_SESSION[$key] = $value;
|
||||
@session_write_close();
|
||||
}
|
||||
|
||||
|
||||
static public function sessionCheck($key,$value='success'){
|
||||
$session = self::init();
|
||||
if( isset($session[$key]) && $session[$key] == $value){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 直接调用kod的登陆检测(适用于同服务器同域名;)
|
||||
* @param [type] $kodHost kod的地址;例如 http://test.com/ ;默认为插件目录
|
||||
* @param [type] $appKey 应用标记 例如 loginCheck
|
||||
* @param [type] $appUrl 验证后跳转到的url;默认为当前url
|
||||
* @param [type] $auth 验证方式:例如:'check=userName&value=smartx'
|
||||
* check (userID|userName|roleID|roleName|groupID|groupName) 校验方式,为空则所有登陆用户
|
||||
*/
|
||||
static public function sessionAuth($appKey,$auth,$kodHost='',$appUrl=''){
|
||||
if($kodHost==''){
|
||||
$appUrl = this_url();
|
||||
if(strstr($appUrl,'/plugins/')){
|
||||
$kodHost = substr($appUrl,0,strpos($appUrl,'/plugins/'));
|
||||
}else{
|
||||
if(isset($_COOKIE['APP_HOST'])){
|
||||
$kodHost = $_COOKIE['APP_HOST'];
|
||||
}else{
|
||||
$kodHost = $_SERVER['HTTP_REFERER'];
|
||||
if(strstr($kodHost,'/index.php?')){
|
||||
$kodHost = substr($kodHost,0,strpos($kodHost,'/index.php?'));
|
||||
}else if(strstr($kodHost,'/?')){
|
||||
$kodHost = substr($kodHost,0,strpos($kodHost,'/?'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$authUrl = rtrim($kodHost,'/').'/index.php?user/sso&app='.$appKey.'&'.$auth;
|
||||
if($appUrl == ''){
|
||||
$appUrl = this_url();
|
||||
}
|
||||
if(!self::sessionCheck($appKey)){
|
||||
session_destroy();
|
||||
header('Location: '.$authUrl.'&link='.rawurlencode($appUrl));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
|
||||
class api extends Controller{
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用文件预览方案
|
||||
* image,media,cad,office,webodf,pdf,epub,swf,text
|
||||
* 跨域:epub,pdf,odf,[text];
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function view(){
|
||||
if(!isset($this->in['path'])){
|
||||
show_tips('参数错误!');
|
||||
}
|
||||
$this->checkAccessToken();
|
||||
$this->setIdentify();
|
||||
$this->display('view.html');
|
||||
}
|
||||
private function setIdentify(){
|
||||
if(! $_SESSION['accessPlugin'] ){
|
||||
session_start();
|
||||
$_SESSION['accessPlugin'] = 'ok';
|
||||
session_write_close();
|
||||
}
|
||||
}
|
||||
public function checkAccessToken(){
|
||||
$model = $this->loadModel('Plugin');
|
||||
$config = $model->getConfig('fileView');
|
||||
if(!$config['apiKey']){
|
||||
return;
|
||||
}
|
||||
$timeTo = isset($this->in['timeTo'])?intval($this->in['timeTo']):'';
|
||||
$token = md5($config['apiKey'].$this->in['path'].$timeTo);
|
||||
|
||||
//show_tips(array($config['apiKey'],$token,$this->in));
|
||||
if($token != $this->in['token']){
|
||||
show_tips('token 错误!');
|
||||
}
|
||||
if($timeTo != '' && $timeTo <= time()){
|
||||
show_tips('token已失效!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,141 @@
|
||||
<?php
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
|
||||
class app extends Controller{
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->sql=new FileCache(USER_SYSTEM.'apps.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户首页展示
|
||||
*/
|
||||
public function index() {
|
||||
$this->display('index.html');
|
||||
}
|
||||
|
||||
public function initApp(){
|
||||
//为空则不初始化桌面
|
||||
if(!$this->config['settingSystem']['desktopFolder']){
|
||||
return;
|
||||
}
|
||||
$list = $this->sql->get();
|
||||
$newUserApp = $this->config['settingSystem']['newUserApp'];
|
||||
$default = explode(',',$newUserApp);
|
||||
$info = array();
|
||||
foreach ($default as $key) {
|
||||
$info[$key] = $list[$key];
|
||||
}
|
||||
|
||||
$desktop = iconv_system(HOME.DESKTOP_FOLDER.'/');
|
||||
if($GLOBALS['isRoot'] == 1){
|
||||
$desktop = iconv_system(MYHOME.DESKTOP_FOLDER.'/');
|
||||
}
|
||||
mk_dir($desktop);
|
||||
if(!path_writeable($desktop)){
|
||||
return;
|
||||
}
|
||||
foreach ($info as $key => $data) {
|
||||
if (!is_array($data)) {
|
||||
continue;
|
||||
}
|
||||
$path = $desktop.iconv_system($key).'.oexe';
|
||||
unset($data['name']);
|
||||
unset($data['desc']);
|
||||
unset($data['group']);
|
||||
file_put_contents($path, json_encode($data));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户app 添加、编辑
|
||||
*/
|
||||
public function userApp() {
|
||||
$path = _DIR($this->in['path']);
|
||||
if(get_path_ext($path) != 'oexe'){
|
||||
$path .= '.oexe';
|
||||
}
|
||||
if (!checkExt($path)) {
|
||||
show_json(LNG('error'));exit;
|
||||
}
|
||||
|
||||
$data = $this->_init();
|
||||
unset($data['name']);
|
||||
unset($data['path']);
|
||||
unset($data['desc']);
|
||||
unset($data['group']);
|
||||
$res = file_put_contents($path, json_encode($data));
|
||||
show_json(LNG('success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
public function get() {
|
||||
$list = array();
|
||||
if (!isset($this->in['group']) || $this->in['group']=='all') {
|
||||
$list = $this->sql->get();
|
||||
}else{
|
||||
$list = $this->sql->get(array('group',$this->in['group']));
|
||||
}
|
||||
$list = array_reverse($list);
|
||||
show_json($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public function add() {
|
||||
$res=$this->sql->set(rawurldecode($this->in['name']),$this->_init());
|
||||
if($res) show_json(LNG('success'));
|
||||
show_json(LNG('error_repeat'),false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit() {
|
||||
//查找到一条记录,修改为该数组
|
||||
$this->sql->remove(rawurldecode($this->in['old_name']));
|
||||
if($this->sql->set(rawurldecode($this->in['name']),$this->_init())){
|
||||
show_json(LNG('success'));
|
||||
}
|
||||
show_json(LNG('error_repeat'),false);
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del() {
|
||||
if($this->sql->remove(rawurldecode($this->in['name']))){
|
||||
show_json(LNG('success'));
|
||||
}
|
||||
show_json(LNG('error'),false);
|
||||
}
|
||||
|
||||
public function getUrlTitle(){
|
||||
$html = curl_get_contents($this->in['url']);
|
||||
$result = match_text($html,"<title>(.*)<\/title>");
|
||||
if (strlen($result)>50) {
|
||||
$result = mb_substr($result,0,50,'utf-8');
|
||||
}
|
||||
if (!$result || strlen($result) == 0) {
|
||||
$result = $this->in['url'];
|
||||
$result = str_replace(array('http://','&','/'),array('','@','-'), $result);
|
||||
}
|
||||
show_json($result);
|
||||
}
|
||||
|
||||
private function _init(){
|
||||
$data = rawurldecode($this->in['data']);
|
||||
$arr = json_decode($data,true);
|
||||
if(!is_array($arr)){
|
||||
show_json(LNG('error'),false);
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
|
||||
class desktop extends Controller{
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
public function index() {
|
||||
$wap = is_wap() && (!isset($_COOKIE['forceWap']) || $_COOKIE['forceWap'] == '1');
|
||||
$desktopApps = include(DATA_PATH.'system/desktop_app.php');
|
||||
$wall = $this->config['user']['wall'];
|
||||
if( !strstr($wall,'/') ){
|
||||
$wall = STATIC_PATH.'images/wall_page/'.$wall.'.jpg';
|
||||
}
|
||||
|
||||
$wall = str_replace('&','&',$wall);
|
||||
$desktop = iconv_system(HOME.DESKTOP_FOLDER.'/');
|
||||
if($GLOBALS['isRoot'] == 1){
|
||||
$desktop = iconv_system(MYHOME.DESKTOP_FOLDER.'/');
|
||||
}
|
||||
mk_dir($desktop);
|
||||
|
||||
$this->assign('wall',$wall);
|
||||
$this->assign('desktopApps',$desktopApps);
|
||||
$this->display('index.html');
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
|
||||
class fav extends Controller{
|
||||
private $sql;
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->sql=new FileCache(USER.'data/fav.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收藏夹json
|
||||
*/
|
||||
public function get() {
|
||||
show_json($this->sql->get());
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public function add() {
|
||||
$name = $this->in['name'];
|
||||
$path = $this->in['path'];
|
||||
if($this->sql->get($name)){//已存在则自动重命名
|
||||
$index = 0;
|
||||
while ($this->sql->get($name.'('.$index.')')) {
|
||||
$index ++;
|
||||
}
|
||||
$name = $name.'('.$index.')';
|
||||
}
|
||||
$res=$this->sql->set(
|
||||
$name,
|
||||
array(
|
||||
'name' => $name,
|
||||
'path' => $path,
|
||||
'ext' => $this->in['ext'],
|
||||
'type' => $this->in['type']
|
||||
)
|
||||
);
|
||||
show_json(LNG('success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit() {
|
||||
$this->in['name'] = $this->in['name'];
|
||||
$this->in['path'] = $this->in['path'];
|
||||
$this->in['nameTo'] = $this->in['nameTo'];
|
||||
$newFav = $this->sql->get($this->in['name']);
|
||||
if(!isset($newFav['type'])){
|
||||
$newFav['type'] = 'folder';
|
||||
}
|
||||
//查找到一条记录,修改为该数组
|
||||
$toArray=array(
|
||||
'name'=>$this->in['nameTo'],
|
||||
'path'=>$this->in['pathTo'],
|
||||
'type'=>$newFav['type']
|
||||
);
|
||||
$this->sql->remove($this->in['name']);
|
||||
if($this->sql->set($this->in['nameTo'],$toArray)){
|
||||
show_json(LNG('success'));
|
||||
}
|
||||
show_json(LNG('error_repeat'),false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del() {
|
||||
$this->in['name'] = $this->in['name'];
|
||||
if($this->sql->remove($this->in['name'])){
|
||||
show_json(LNG('success'));
|
||||
}
|
||||
show_json(LNG('error'),false);
|
||||
}
|
||||
}
|
@ -0,0 +1,223 @@
|
||||
<?php
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*
|
||||
*
|
||||
* 插件管理:页面;列表;
|
||||
*/
|
||||
|
||||
class pluginApp extends Controller{
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
//?pluginApp/to/epubReader/index&a=1
|
||||
//?pluginApp/to/epubReader/&a=1 ==>ignore index;
|
||||
public function to() {
|
||||
$route = $this->in['URLremote'];
|
||||
if(count($route) >= 3){
|
||||
$app = clear_html($route[2]);
|
||||
$action = $route[3];
|
||||
|
||||
if(count($route) == 3){
|
||||
$action = 'index';
|
||||
}
|
||||
$model = $this->loadModel('Plugin');
|
||||
if(!$model->checkAuth($app)){
|
||||
if(!$_SESSION['kodLogin']){
|
||||
show_tips("出错了!您尚未登录",APP_HOST,3);
|
||||
}
|
||||
show_tips("出错了!插件未开启,或您没有{$app}插件的权限!");
|
||||
}
|
||||
|
||||
$appConfig = $model->getConfig($app);
|
||||
if(!$appConfig['pluginAuthOpen'] && !$this->checkAccessPlugin()){
|
||||
if(!$_SESSION['kodLogin']){
|
||||
show_tips("出错了!您尚未登录",APP_HOST,3);
|
||||
}
|
||||
show_tips("出错了!插件未开启,或您没有{$app}插件的权限");
|
||||
}
|
||||
Hook::trigger("pluginRun.before",$app.'Plugin.'.$action);
|
||||
Hook::trigger($app.'Plugin.'.$action.'.before');
|
||||
Hook::apply($app.'Plugin.'.$action);
|
||||
Hook::trigger($app.'Plugin.'.$action.'.after');
|
||||
Hook::trigger("pluginRun.after",$app.'Plugin.'.$action);
|
||||
}
|
||||
}
|
||||
|
||||
//权限认证
|
||||
private function checkAccessPlugin(){
|
||||
if( $_SESSION['kodLogin'] == true ||
|
||||
$_SESSION['accessPlugin'] == 'ok' ||
|
||||
$this->checkAccessShare()
|
||||
){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
private function checkAccessShare(){
|
||||
if(!isset($this->in['path'])){
|
||||
return false;
|
||||
}
|
||||
$share = KOD_USER_SHARE;
|
||||
if(substr(urldecode($this->in['path']),0,strlen($share)) == $share){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//plugin manager
|
||||
public function index() {
|
||||
$this->display('index.html');
|
||||
}
|
||||
|
||||
public function appList(){
|
||||
$model = $this->loadModel('Plugin');
|
||||
$list = $model->viewList();
|
||||
show_json($list);
|
||||
}
|
||||
|
||||
public function changeStatus(){
|
||||
if( !isset($this->in['app']) ||
|
||||
!isset($this->in['status'])){
|
||||
show_json(LNG('data_not_full'),false);
|
||||
}
|
||||
$app = $this->in['app'];
|
||||
$status = $this->in['status']?1:0;
|
||||
$model = $this->loadModel('Plugin');
|
||||
|
||||
//启用插件则检测配置文件,必填字段是否为空;为空则调用配置
|
||||
if($status){
|
||||
$config = $model->getConfig($app);
|
||||
$package = $model->getPackageJson($app);
|
||||
$needConfig = false;
|
||||
foreach($package['configItem'] as $key=>$item) {
|
||||
if( (isset($item['require']) && $item['require']) &&
|
||||
(!isset($item['value']) || $item['value'] === '' || $item['value'] === null) &&
|
||||
(!isset($config[$key]) || $config[$key] == "")
|
||||
){
|
||||
$needConfig = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if($needConfig){
|
||||
show_json('needConfig',false);
|
||||
}
|
||||
}
|
||||
$model->changeStatus($app,$status);
|
||||
$list = $model->viewList();
|
||||
show_json($list);
|
||||
}
|
||||
|
||||
public function setConfig(){
|
||||
if( !$this->in['app'] ||
|
||||
!$this->in['value']){
|
||||
show_json(LNG('data_not_full'),false);
|
||||
}
|
||||
$json = $this->in['value'];
|
||||
$app = $this->in['app'];
|
||||
$model = $this->loadModel('Plugin');
|
||||
|
||||
//重置为默认配置
|
||||
if($json == 'reset'){
|
||||
$json = $model->getConfigDefault($app);
|
||||
}else{
|
||||
if(!is_array($json)){
|
||||
show_json($json,false);
|
||||
}
|
||||
}
|
||||
$model->changeStatus($app,1);
|
||||
$model->setConfig($app,$json);
|
||||
show_json(LNG('success'));
|
||||
}
|
||||
|
||||
// download=>fileSize=>unzip=>remove
|
||||
public function install(){
|
||||
if(!preg_match("/^[0-9a-zA-Z_]*$/",$this->in['app'])) show_json("error!",false);
|
||||
$app = _DIR_CLEAR($this->in['app']);
|
||||
$appPath = PLUGIN_DIR.$app.'.zip';
|
||||
$appPathTemp = $appPath.'.downloading';
|
||||
switch($this->in['step']){
|
||||
case 'check':
|
||||
$info = $this->pluginInfo($app);
|
||||
if(!is_array($info)){
|
||||
show_json(false,false);
|
||||
}
|
||||
echo json_encode($info);
|
||||
break;
|
||||
case 'download':
|
||||
if(!is_writable(PLUGIN_DIR)){
|
||||
show_json(LNG("no_permission_write").': '.PLUGIN_DIR,false);
|
||||
}
|
||||
$info = $this->pluginInfo($app);
|
||||
if(!$info || !$info['code']){
|
||||
show_json(LNG('error'),false);
|
||||
}
|
||||
$result = Downloader::start($info['data'],$appPath);
|
||||
show_json($result['data'],!!$result['code'],$app);
|
||||
break;
|
||||
case 'fileSize':
|
||||
if(file_exists($appPath)){
|
||||
show_json(filesize($appPath));
|
||||
}
|
||||
if(file_exists($appPathTemp)){
|
||||
show_json(filesize($appPathTemp));
|
||||
}
|
||||
show_json(0,false);
|
||||
break;
|
||||
case 'unzip':
|
||||
//hook log
|
||||
$GLOBALS['isRoot'] = 1;
|
||||
if(!file_exists($appPath)){
|
||||
show_json(LNG("error"),false);
|
||||
}
|
||||
$result = KodArchive::extract($appPath,PLUGIN_DIR.$app.'/');
|
||||
del_file($appPathTemp);
|
||||
del_file($appPath);
|
||||
show_json($result['data'],!!$result['code']);
|
||||
break;
|
||||
case 'remove':
|
||||
del_file($appPathTemp);
|
||||
del_file($appPath);
|
||||
show_json(LNG('success'));
|
||||
break;
|
||||
case 'update':
|
||||
show_json(Hook::apply($app.'Plugin.update'));
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
private function pluginInfo($app){
|
||||
$api = $this->config['settings']['pluginServer'].'plugin/install';
|
||||
$param = array(
|
||||
"app" => $app,
|
||||
"version" => KOD_VERSION,
|
||||
"versionHash" => $this->config['settingSystem']['versionHash'],
|
||||
"systemOS" => $this->config['systemOS'],
|
||||
"phpVersion" => PHP_VERSION,
|
||||
"channel" => INSTALL_CHANNEL,
|
||||
"lang" => I18n::getType()
|
||||
);
|
||||
$info = url_request($api,'POST',$param);
|
||||
$result = false;
|
||||
if($info && $info['data']){
|
||||
$result = json_decode($info['data'],true);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function unInstall(){
|
||||
if( !$this->in['app']){
|
||||
show_json(LNG('data_not_full'),false);
|
||||
}
|
||||
if(!preg_match("/^[0-9a-zA-Z_]*$/",$this->in['app'])) show_json("error!",false);
|
||||
$model = $this->loadModel('Plugin');
|
||||
$model->remove($this->in['app']);
|
||||
del_dir(PLUGIN_DIR.$this->in['app']);
|
||||
$list = $model->viewList();
|
||||
show_json($list);
|
||||
}
|
||||
}
|
@ -0,0 +1,631 @@
|
||||
<?php
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
|
||||
class share extends Controller{
|
||||
private $sql;
|
||||
private $shareInfo;
|
||||
private $sharePath;
|
||||
private $path;
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$auth = systemRole::getInfo(1);//经过role检测
|
||||
|
||||
$arrNotCheck = array('commonJs','manifest','manifestJS');
|
||||
if(substr($this->in['fileUrl'],0,4) == 'http'){
|
||||
$arrNotCheck[] = 'fileGet';
|
||||
}
|
||||
if (!in_array(ACT,$arrNotCheck)){
|
||||
$this->initShare();
|
||||
$this->checkShare();
|
||||
$this->assign('canDownload',$this->shareInfo['notDownload']=='1'?0:1);
|
||||
}
|
||||
//需要检查下载权限的Action
|
||||
$arrCheckDownload = array('fileDownload','zipDownload');//'fileProxy','fileGet'
|
||||
if (in_array(ACT,$arrCheckDownload)){
|
||||
if ($this->shareInfo['notDownload']=='1') {
|
||||
show_json(LNG('share_not_download_tips'),false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function initShare(){
|
||||
if(isset($this->in['user'])){
|
||||
$this->initShareOld();
|
||||
return;
|
||||
}
|
||||
$this->path = _DIR($this->in['path']);
|
||||
$this->shareInfo = $GLOBALS['kodShareInfo'];
|
||||
$user = systemMember::getInfo($GLOBALS['kodPathId']);
|
||||
|
||||
$userHome = user_home_path($user);
|
||||
define('USER',USER_PATH.$user['path'].'/');
|
||||
define('USER_TEMP',USER.'data/share_temp/');
|
||||
define('HOME',$userHome);
|
||||
}
|
||||
|
||||
private function checkShare(){
|
||||
$shareInfo = $this->shareInfo;
|
||||
if(!$this->shareInfo){
|
||||
$this->_error(LNG('share_error_user'));
|
||||
}
|
||||
if (isset($shareInfo['timeTo'])&&
|
||||
strlen($shareInfo['timeTo'])!=0) {
|
||||
$date = strtotime($shareInfo['timeTo']);
|
||||
if (time() > $date) {
|
||||
$this->_error(LNG('share_error_time'));
|
||||
}
|
||||
}
|
||||
//密码检测
|
||||
if ($shareInfo['sharePassword']=='') return;
|
||||
if (!isset($this->in['password'])){
|
||||
if ($_SESSION['password_'.$this->in['sid']]==$shareInfo['sharePassword']){
|
||||
return;
|
||||
}
|
||||
$this->_error('password');
|
||||
}else{
|
||||
if ($this->in['password'] == $shareInfo['sharePassword']) {
|
||||
session_start();
|
||||
$_SESSION['password_'.$this->in['sid']]=$shareInfo['sharePassword'];
|
||||
session_write_close();
|
||||
show_json('success');
|
||||
}else{
|
||||
show_json(LNG('share_error_password'),false);
|
||||
}
|
||||
}
|
||||
}
|
||||
private function initShareOld(){
|
||||
if (!isset($this->in['user']) || !isset($this->in['sid'])) {
|
||||
$this->_error(LNG('share_error_param'));
|
||||
}
|
||||
$member = systemMember::loadData();
|
||||
$user = $member->get($this->in['user']);
|
||||
if (!is_array($user) || !isset($user['password'])){
|
||||
$this->_error(LNG('share_error_user'));
|
||||
}
|
||||
|
||||
$userHome = user_home_path($user);
|
||||
define('USER',USER_PATH.$user['path'].'/');
|
||||
define('USER_TEMP',USER.'data/share_temp/');
|
||||
define('HOME',$userHome);
|
||||
$shareData = USER_PATH.$user['path'].'/data/share.php';
|
||||
if (!file_exists(iconv_system($shareData))) {
|
||||
$this->_error(LNG('share_error_user'));
|
||||
}
|
||||
$this->sql=new FileCache($shareData);
|
||||
$list = $this->sql->get();
|
||||
if (!isset($this->in['sid']) ||! $list[$this->in['sid']]){
|
||||
$this->_error(LNG('share_error_sid'));
|
||||
}
|
||||
$this->shareInfo = $list[$this->in['sid']];
|
||||
$sharePath = _DIR_CLEAR($this->shareInfo['path']);
|
||||
if ($user['role'] != '1') {
|
||||
$sharePath = HOME.ltrim($sharePath,'/');
|
||||
}
|
||||
if ($this->shareInfo['type'] != 'file'){
|
||||
$sharePath=rtrim($sharePath,'/').'/';
|
||||
}
|
||||
$sharePath = iconv_system($sharePath);
|
||||
if (!file_exists($sharePath)) {
|
||||
$this->_error(LNG('share_error_path'));
|
||||
}
|
||||
$this->sharePath = $sharePath;
|
||||
if($this->shareInfo['type'] == 'file'){
|
||||
$this->path = $sharePath;
|
||||
}else if(isset($this->in['path'])){
|
||||
$this->path = $sharePath.$this->_clear($this->in['path']);
|
||||
}else{
|
||||
$this->path = $sharePath;
|
||||
}
|
||||
$this->path = _DIR_CLEAR($this->path);
|
||||
$GLOBALS['kodPathPre'] = iconv_app(_DIR_CLEAR($sharePath));
|
||||
//debug_out($GLOBALS['kodPathPre'],$GLOBALS['kodPathId'],$this->shareInfo,$this->path,$sharePath);
|
||||
}
|
||||
private function _clear($path){
|
||||
return iconv_system(_DIR_CLEAR($path));
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function _error($msg){
|
||||
$this->assign('configTheme','mac');
|
||||
$this->assign('msg',$msg);
|
||||
$this->display('tips.html');
|
||||
exit;
|
||||
}
|
||||
//==========================
|
||||
//页面统一注入变量
|
||||
private function _assignInfo(){
|
||||
$config = FileCache::load(USER.'data/config.php');
|
||||
if (count($config)<1) {
|
||||
$config = $GLOBALS['config']['settingDefault'];
|
||||
}
|
||||
$this->assign('configTheme',$config['theme']);
|
||||
$this->shareInfo['sharePassword'] = '';
|
||||
$this->shareInfo['path'] = get_path_this(iconv_app($this->path));
|
||||
$this->assign('shareInfo',$this->shareInfo);
|
||||
}
|
||||
|
||||
//下载次数统计
|
||||
private function _shareDownloadAdd(){
|
||||
$this->shareInfo['numDownload'] = abs(intval($this->shareInfo['numDownload'])) +1;
|
||||
$this->sql->set($this->in['sid'],$this->shareInfo);
|
||||
}
|
||||
|
||||
//==========================
|
||||
/*
|
||||
* 文件浏览
|
||||
*/
|
||||
public function file() {
|
||||
$this->shareViewAdd();
|
||||
if ($this->shareInfo['type']!='file') {
|
||||
//$this->shareInfo['name'] = get_path_this($this->path);
|
||||
}
|
||||
$size = filesize($this->path);
|
||||
$this->shareInfo['size'] = size_format($size);
|
||||
$this->_assignInfo();
|
||||
$this->display('file.html');
|
||||
}
|
||||
/*
|
||||
* 文件夹浏览
|
||||
*/
|
||||
public function folder() {
|
||||
$this->shareViewAdd();
|
||||
if(isset($this->in['path']) && $this->in['path'] !=''){
|
||||
$dir = '/'._DIR_CLEAR($this->in['path']);
|
||||
}else{
|
||||
$dir = '/';//首次进入系统,不带参数
|
||||
}
|
||||
$dir = '/'.trim($dir,'/').'/';
|
||||
$this->_assignInfo();
|
||||
$this->assign('dir',$dir);
|
||||
|
||||
if ($this->config['forceWap']) {
|
||||
$this->display('explorerWap.html');
|
||||
}else{
|
||||
$this->display('explorer.html');
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 代码阅读
|
||||
*/
|
||||
public function codeRead() {
|
||||
$this->shareViewAdd();
|
||||
$this->_assignInfo();
|
||||
$this->display('editor.html');
|
||||
}
|
||||
//浏览次数统计
|
||||
private function shareViewAdd(){
|
||||
$this->shareInfo['numDownload'] = isset($this->shareInfo['numDownload'])?$this->shareInfo['numDownload']:0;
|
||||
$this->shareInfo['numView'] = isset($this->shareInfo['numView'])?$this->shareInfo['numView']:0;
|
||||
|
||||
$this->shareInfo['numView'] = abs(intval($this->shareInfo['numView'])) +1;
|
||||
$this->sql->set($this->in['sid'],$this->shareInfo);
|
||||
}
|
||||
public function commonJs(){
|
||||
$out = ob_get_clean();
|
||||
$versionDesc = isset($this->config['settings']['versionDesc'])?$this->config['settings']['versionDesc']:"";
|
||||
$theConfig = array(
|
||||
'environment' => STATIC_JS,
|
||||
'lang' => I18n::getType(),
|
||||
'systemOS' => $this->config['systemOS'],
|
||||
'isRoot' => 0,
|
||||
'webRoot' => '',
|
||||
'webHost' => HOST,
|
||||
'appHost' => APP_HOST,
|
||||
'staticPath' => STATIC_PATH,
|
||||
'appIndex' => $_SERVER['SCRIPT_NAME'],
|
||||
'version' => KOD_VERSION,
|
||||
'versionBuild' => KOD_VERSION_BUILD,
|
||||
'versionDesc' => $versionDesc,
|
||||
'kodID' => md5(BASIC_PATH.$this->config['settingSystem']['systemPassword']),
|
||||
|
||||
'jsonData' => "",
|
||||
'sharePage' => 'share',
|
||||
'settings' => array(
|
||||
'updloadChunkSize' => file_upload_size(),
|
||||
'updloadThreads' => $this->config['settings']['updloadThreads'],
|
||||
'updloadBindary' => $this->config['settings']['updloadBindary'],
|
||||
'uploadCheckChunk' => $this->config['settings']['uploadCheckChunk'],
|
||||
|
||||
'paramRewrite' => $this->config['settings']['paramRewrite'],
|
||||
'pluginServer' => $this->config['settings']['pluginServer'],
|
||||
//'appType' => $this->config['settings']['appType']
|
||||
),
|
||||
|
||||
//虚拟目录
|
||||
'KOD_GROUP_PATH' => KOD_GROUP_PATH,
|
||||
'KOD_GROUP_SHARE' => KOD_GROUP_SHARE,
|
||||
'KOD_USER_SELF' => KOD_USER_SELF,
|
||||
'KOD_USER_SHARE' => KOD_USER_SHARE,
|
||||
'KOD_USER_RECYCLE' => KOD_USER_RECYCLE,
|
||||
'KOD_USER_FAV' => KOD_USER_FAV,
|
||||
'KOD_GROUP_ROOT_SELF' => KOD_GROUP_ROOT_SELF,
|
||||
'KOD_GROUP_ROOT_ALL' => KOD_GROUP_ROOT_ALL,
|
||||
'ST' => $this->in['st'],
|
||||
'ACT' => $this->in['act'],
|
||||
);
|
||||
|
||||
if(ST.''.ACT == 'explorer.fileView'){
|
||||
unset($theConfig['sharePage']);
|
||||
}
|
||||
|
||||
$userConfig = $GLOBALS['config']['settingDefault'];
|
||||
if(isset($this->in['user'])){
|
||||
$member = systemMember::loadData();
|
||||
$user = $member->get($this->in['user']);
|
||||
$userConfig = FileCache::load(USER_PATH.$user['path'].'/'.'data/config.php');
|
||||
}
|
||||
|
||||
if(isset($this->config['settingSystem']['versionHash'])){
|
||||
$theConfig['versionHash'] = $this->config['settingSystem']['versionHash'];
|
||||
$theConfig['versionHashUser'] = $this->config['settingSystem']['versionHashUser'];
|
||||
}
|
||||
$theConfig['userConfig'] = $userConfig;
|
||||
$useTime = mtime() - $GLOBALS['config']['appStartTime'];
|
||||
|
||||
header("Content-Type: application/javascript; charset=utf-8");
|
||||
echo 'if(typeof(kodReady)=="undefined"){kodReady=[];}';
|
||||
Hook::trigger('user.commonJs.insert',$this->in['st'],$this->in['act']);
|
||||
echo ';AUTH=[];';
|
||||
echo 'G='.json_encode($theConfig).';';
|
||||
$lang = json_encode_force(I18n::getAll());
|
||||
if(!$lang){
|
||||
$lang = '{}';
|
||||
}
|
||||
echo 'LNG='.$lang.';G.useTime='.$useTime.';';
|
||||
}
|
||||
//chrome安装: 必须https;serviceWorker引入处理;manifest配置; [manifest.json配置目录同sw.js引入];
|
||||
public function manifest(){
|
||||
$json = file_get_contents(BASIC_PATH.'static/others/app/manifest.json');
|
||||
$name = stristr(I18n::getType(),'zh') ? '可道云':'kodExplorer';
|
||||
$static = STATIC_PATH == './static/' ? APP_HOST.'static/':STATIC_PATH;
|
||||
$assign = array(
|
||||
"{{name}}" => $name,
|
||||
"{{appDesc}}" => LNG('common.copyright.name'),
|
||||
"{{static}}" => $static,
|
||||
);
|
||||
$json = str_replace(array_keys($assign),array_values($assign),$json);
|
||||
header("Content-Type: application/javascript; charset=utf-8");
|
||||
echo $json;
|
||||
}
|
||||
public function manifestJS(){
|
||||
header("Content-Type: application/javascript; charset=utf-8");
|
||||
echo file_get_contents(BASIC_PATH.'static/others/app/sw.js');
|
||||
}
|
||||
|
||||
|
||||
//========ajax function============
|
||||
public function pathInfo(){
|
||||
$infoList = json_decode($this->in['dataArr'],true);
|
||||
foreach ($infoList as &$val) {
|
||||
$val['path'] = $this->sharePath.$this->_clear($val['path']);
|
||||
}
|
||||
$data = path_info_muti($infoList,LNG('time_type_info'));
|
||||
$data['path'] = _DIR_OUT($data['path']);
|
||||
|
||||
//属性查看,单个文件则生成临时下载地址。没有权限则不显示
|
||||
if (count($infoList)==1 && $infoList[0]['type']!='folder') {//单个文件
|
||||
$file = $infoList[0]['path'];
|
||||
if($this->shareInfo['notDownload']!='1'){
|
||||
$data['downloadPath'] = _make_file_proxy($file);
|
||||
}
|
||||
if($data['size'] < 100*1024|| isset($this->in['getMd5'])){
|
||||
$data['fileMd5'] = @md5_file($file);
|
||||
}else{
|
||||
$data['fileMd5'] = "...";
|
||||
}
|
||||
|
||||
//获取图片尺寸
|
||||
$ext = get_path_ext($file);
|
||||
if(in_array($ext,array('jpg','gif','png','jpeg','bmp')) ){
|
||||
$size = ImageThumb::imageSize($file);
|
||||
if($size){
|
||||
$data['imageSize'] = $size;
|
||||
}
|
||||
}
|
||||
}
|
||||
show_json($data);
|
||||
}
|
||||
public function fileSave(){
|
||||
show_json(LNG('no_permission'),false);
|
||||
}
|
||||
|
||||
// 单文件编辑
|
||||
public function edit(){
|
||||
$member = systemMember::loadData();
|
||||
$user = $member->get($this->in['user']);
|
||||
$codeConfig = FileCache::load(USER_PATH.$user['path'].'/data/editor_config.php');
|
||||
if(!is_array($codeConfig)){
|
||||
$codeConfig = $GLOBALS['config']['editorDefault'];
|
||||
}
|
||||
|
||||
$black_theme = array("ambiance","idle_fingers","monokai","pastel_on_dark","twilight",
|
||||
"solarized_dark","tomorrow_night_blue","tomorrow_night_eighties");
|
||||
$setClass = "";
|
||||
if(in_array($codeConfig['theme'],$black_theme)){
|
||||
$setClass = 'class="code-theme-black"';
|
||||
}
|
||||
$this->_assignInfo();
|
||||
$this->assign('editorConfig',json_encode($codeConfig));//获取编辑器配置信息
|
||||
$this->assign('codeThemeBlack',$setClass);//获取编辑器配置信息
|
||||
$this->display('edit.html');
|
||||
}
|
||||
|
||||
public function pathList(){
|
||||
$list=$this->_path($this->path);
|
||||
show_json($list);
|
||||
}
|
||||
public function treeList(){
|
||||
$path=$this->path;
|
||||
if (isset($this->in['project'])) {
|
||||
$path = $this->sharePath.$this->_clear($this->in['project']);
|
||||
}
|
||||
if (isset($this->in['path'])) {
|
||||
$path = $this->sharePath.$this->_clear($this->in['path']);
|
||||
}
|
||||
if (isset($this->in['name'])){
|
||||
$path=$path.'/'.$this->_clear($this->in['name']);
|
||||
}
|
||||
$listFile = ($this->in['app'] == 'editor'?true:false);//编辑器内列出文件
|
||||
$list=$this->_path($path,$listFile,true);
|
||||
function sort_by_key($a, $b){
|
||||
if ($a['name'] == $b['name']) return 0;
|
||||
return ($a['name'] > $b['name']) ? 1 : -1;
|
||||
}
|
||||
usort($list['folderList'], "sort_by_key");
|
||||
usort($list['fileList'], "sort_by_key");
|
||||
|
||||
$result = array_merge($list['folderList'],$list['fileList']);
|
||||
if ($this->in['app'] != 'editor') {
|
||||
$result =$list['folderList'];
|
||||
}
|
||||
if (isset($this->in['type']) && $this->in['type']=='init') {
|
||||
$result = array(
|
||||
array(
|
||||
'name' => iconv_app(get_path_this($path)),
|
||||
'children' => $result,
|
||||
//'menuType' => "menuTreeRoot",
|
||||
'open' => true,
|
||||
'type' => 'folder',
|
||||
'path' => '/',
|
||||
'isParent' => count($result)>0?true:false
|
||||
)
|
||||
);
|
||||
}
|
||||
show_json($result);
|
||||
}
|
||||
public function search(){
|
||||
if (!isset($this->in['search'])) show_json(LNG('please_inpute_search_words'),false);
|
||||
$isContent = intval($this->in['is_content']);
|
||||
$isCase = intval($this->in['is_case']);
|
||||
$ext= trim($this->in['ext']);
|
||||
$list = path_search(
|
||||
$this->path,
|
||||
rawurldecode($this->in['search']),
|
||||
$isContent,$ext,$isCase);
|
||||
|
||||
show_json(_DIR_OUT($list));
|
||||
}
|
||||
/**
|
||||
* 上传,html5拖拽 flash 多文件
|
||||
*/
|
||||
public function fileUpload(){
|
||||
$fileName = $_FILES['file']['name']? $_FILES['file']['name']:$GLOBALS['in']['name'];
|
||||
$GLOBALS['isRoot']=0;
|
||||
$GLOBALS['auth']['extNotAllow'] = "htm|html|php|phtml|pwml|asp|aspx|ascx|jsp|pl|htaccess|shtml|shtm|phtm";
|
||||
if(!checkExt($fileName)){
|
||||
show_json(LNG('no_permission_ext'),false);
|
||||
}
|
||||
$savePath = $this->sharePath.$this->_clear($this->in['upload_to']);
|
||||
if (!path_writeable($savePath)) show_json(LNG('no_permission_write'),false);
|
||||
|
||||
if ($savePath == '') show_json(LNG('upload_error_big'),false);
|
||||
if (strlen($this->in['fullPath']) > 1) {//folder drag upload
|
||||
$fullPath = _DIR_CLEAR(rawurldecode($this->in['fullPath']));
|
||||
$fullPath = get_path_father($fullPath);
|
||||
$fullPath = iconv_system($fullPath);
|
||||
if (mk_dir($savePath.$fullPath)) {
|
||||
$savePath = $savePath.$fullPath;
|
||||
}
|
||||
}
|
||||
|
||||
//分片上传
|
||||
$tempDir = iconv_system(USER_TEMP);
|
||||
mk_dir($tempDir);
|
||||
if (!path_writeable($tempDir)) show_json(LNG('no_permission_write'),false);
|
||||
upload($savePath,$tempDir,'rename');
|
||||
}
|
||||
|
||||
|
||||
//代理输出
|
||||
public function fileProxy(){
|
||||
$mime = get_file_mime(get_path_ext($this->path));
|
||||
if($mime == 'text/plain' && is_file($this->path)){//文本则转编码
|
||||
$fileContents = file_get_contents($this->path);
|
||||
$charset=get_charset($fileContents);
|
||||
if ($charset!='' || $charset!='utf-8') {
|
||||
$fileContents=mb_convert_encoding($fileContents,'utf-8',$charset);
|
||||
}
|
||||
echo $fileContents;
|
||||
return;
|
||||
}
|
||||
$download = isset($_GET['download']);
|
||||
$filename = isset($_GET['downFilename'])?$_GET['downFilename']:false;
|
||||
file_put_out($this->path,$download,$filename);
|
||||
}
|
||||
public function fileDownload(){
|
||||
$this->_shareDownloadAdd();
|
||||
file_put_out($this->path,true);
|
||||
}
|
||||
//文件下载后删除,用于文件夹下载
|
||||
public function fileDownloadRemove(){
|
||||
if ($this->shareInfo['notDownload']=='1') {
|
||||
show_json(LNG('share_not_download_tips'),false);
|
||||
}
|
||||
$path = get_path_this(_DIR_CLEAR($this->in['path']));
|
||||
$path = iconv_system(USER_TEMP.$path);
|
||||
file_put_out($path,true);
|
||||
del_file($path);
|
||||
}
|
||||
public function zipDownload(){
|
||||
$this->_shareDownloadAdd();
|
||||
$userTemp = iconv_system(USER_TEMP);
|
||||
if(!file_exists($userTemp)){
|
||||
mkdir($userTemp);
|
||||
}else{//清除未删除的临时文件,一天前
|
||||
$list = path_list($userTemp,true,false);
|
||||
$maxTime = 3600*24;
|
||||
if ($list['fileList']>=1) {
|
||||
for ($i=0; $i < count($list['fileList']); $i++) {
|
||||
$createTime = $list['fileList'][$i]['mtime'];//最后修改时间
|
||||
if(time() - $createTime >$maxTime){
|
||||
del_file($list['fileList'][$i]['path'].$list['fileList'][$i]['name']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$zipFile = $this->zip($userTemp);
|
||||
show_json(LNG('zip_success'),true,get_path_this($zipFile));
|
||||
}
|
||||
private function zip($zipPath){
|
||||
if (!isset($zipPath)) {
|
||||
show_json(LNG('share_not_download_tips'),false);
|
||||
}
|
||||
ignore_timeout();
|
||||
|
||||
$zipList = json_decode($this->in['dataArr'],true);
|
||||
$listNum = count($zipList);
|
||||
$files = array();
|
||||
for ($i=0; $i < $listNum; $i++) {
|
||||
$item = $this->path.$this->_clear($zipList[$i]['path']);
|
||||
if(file_exists($item)){
|
||||
$files[] = $item;
|
||||
}
|
||||
}
|
||||
if(count($files)==0){
|
||||
show_json(LNG('not_exists'),false);
|
||||
}
|
||||
|
||||
|
||||
//指定目录
|
||||
if (count($files) == 1) {
|
||||
$pathThisName=get_path_this($files[0]);
|
||||
}else{
|
||||
$pathThisName=get_path_this(get_path_father($files[0]));
|
||||
}
|
||||
$zipname = $zipPath.$pathThisName.'.zip';
|
||||
$zipname = get_filename_auto($zipname,date('_H-i-s'));
|
||||
KodArchive::create($zipname,$files);
|
||||
return iconv_app($zipname);
|
||||
}
|
||||
|
||||
|
||||
// 获取文件数据
|
||||
public function fileGet(){
|
||||
if(isset($this->in['fileUrl'])){ //http
|
||||
$displayName = $this->in['name'];
|
||||
$filepath = $this->in['fileUrl'];
|
||||
if(!request_url_safe($filepath)){
|
||||
show_json(LNG('url error!'),false);
|
||||
}
|
||||
}else{
|
||||
$displayName = _DIR_CLEAR($this->in['filename']);
|
||||
$filepath= $this->sharePath.iconv_system($displayName);
|
||||
if (!path_readable($filepath)){
|
||||
show_json(LNG('no_permission_read'),false);
|
||||
}
|
||||
if (filesize($filepath) >= 1024*1024*20){
|
||||
show_json(LNG('edit_too_big'),false);
|
||||
}
|
||||
if (!file_exists($filepath)){
|
||||
show_json(LNG('not_exists'),false);
|
||||
}
|
||||
}
|
||||
|
||||
$fileContents=file_get_contents($filepath);//文件内容
|
||||
$charset=get_charset($fileContents);
|
||||
if ($charset!='' &&
|
||||
$charset!='utf-8' &&
|
||||
function_exists("mb_convert_encoding")
|
||||
){
|
||||
$fileContents=@mb_convert_encoding($fileContents,'utf-8',$charset);
|
||||
}
|
||||
$data = array(
|
||||
'ext' => get_path_ext($displayName),
|
||||
'name' => iconv_app(get_path_this($displayName)),
|
||||
'filename' => $displayName,
|
||||
'charset' => $charset,
|
||||
'base64' => true,// 部分防火墙编辑文件误判问题处理
|
||||
'content' => base64_encode($fileContents)
|
||||
);
|
||||
show_json($data);
|
||||
}
|
||||
|
||||
public function image(){
|
||||
$thumbWidth = 250;
|
||||
if(isset($this->in['thumbWidth'])){
|
||||
$thumbWidth = intval($this->in['thumbWidth']);//自定义预览大图
|
||||
}
|
||||
if(substr($this->path,0,4) == 'http'){
|
||||
header('Location: '.$this->in['path']);
|
||||
exit;
|
||||
}
|
||||
if (@filesize($this->path) <= 1024*50 ||
|
||||
!function_exists('imagecolorallocate') ||
|
||||
get_path_ext($this->path) == 'gif') {//小于50k、不支持gd库、gif图 不再生成缩略图
|
||||
file_put_out($this->path,false);
|
||||
return;
|
||||
}
|
||||
if (!is_dir(DATA_THUMB)){
|
||||
mk_dir(DATA_THUMB);
|
||||
}
|
||||
$image = $this->path;
|
||||
$imageMd5 = @md5_file($image).'_'.$thumbWidth;//文件md5
|
||||
if (strlen($imageMd5)<5) {
|
||||
$imageMd5 = md5($image).'_'.$thumbWidth;
|
||||
}
|
||||
$imageThumb = DATA_THUMB.$imageMd5.'.png';
|
||||
if (!file_exists($imageThumb)){//如果拼装成的url不存在则没有生成过
|
||||
if (get_path_father($image)==DATA_THUMB){//当前目录则不生成缩略图
|
||||
$imageThumb=$this->path;
|
||||
}else {
|
||||
$cm = new ImageThumb($image,'file');
|
||||
$cm->prorate($imageThumb,$thumbWidth,$thumbWidth);//生成等比例缩略图
|
||||
}
|
||||
}
|
||||
if (!file_exists($imageThumb) ||
|
||||
filesize($imageThumb)<100){//缩略图生成失败则使用原图
|
||||
$imageThumb=$this->path;
|
||||
}
|
||||
file_put_out($imageThumb,false);
|
||||
file_put_out($imageThumb);//输出
|
||||
}
|
||||
|
||||
//获取文件列表&哦exe文件json解析
|
||||
private function _path($dir,$listFile=true,$check_children=false){
|
||||
$list = path_list($dir,$listFile,true);
|
||||
$listNew = array('fileList'=>array(),'folderList'=>array());
|
||||
$pathHidden = $this->config['settingSystem']['pathHidden'];
|
||||
$exName = explode(',',$pathHidden);
|
||||
foreach ($list['fileList'] as $key => $val) {
|
||||
if (in_array($val['name'],$exName)) continue;
|
||||
if ($val['ext'] == 'oexe'){
|
||||
$path = iconv_system($val['path']);
|
||||
$json = json_decode(@file_get_contents($path),true);
|
||||
if(is_array($json)) $val = array_merge($val,$json);
|
||||
}
|
||||
$listNew['fileList'][] = $val;
|
||||
}
|
||||
foreach ($list['folderList'] as $key => $val) {
|
||||
if (in_array($val['name'],$exName)) continue;
|
||||
$listNew['folderList'][] = $val;
|
||||
}
|
||||
$s = _DIR_OUT($listNew);
|
||||
return _DIR_OUT($listNew);
|
||||
}
|
||||
}
|
@ -0,0 +1,170 @@
|
||||
<?php
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
|
||||
class systemRole extends Controller{
|
||||
public static $staticSql = null;
|
||||
private $sql;
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->sql= self::loadData();
|
||||
}
|
||||
|
||||
//保证只加载一次文件
|
||||
public static function loadData(){
|
||||
if(is_null(self::$staticSql)){
|
||||
self::$staticSql = systemRoleData();
|
||||
}
|
||||
return self::$staticSql;
|
||||
}
|
||||
public static function getInfo($theId){
|
||||
$sql = self::loadData();
|
||||
return $sql->get($theId);
|
||||
}
|
||||
|
||||
|
||||
//获取所有权限组
|
||||
//用户组权限
|
||||
public function get() {
|
||||
if(isset($this->in['group_role'])){
|
||||
$this->in['action'] == 'get';
|
||||
$this->roleGroupAction();
|
||||
}
|
||||
show_json($this->sql->get());
|
||||
}
|
||||
/**
|
||||
* 权限添加
|
||||
*/
|
||||
public function add(){
|
||||
$role = $this->_initData();
|
||||
$roleId = $role['roleID'] = $this->sql->getMaxId().'';
|
||||
$this->_checkExist( $this->sql->get(),array('name',$role['name']),$roleId );
|
||||
if ($this->sql->set($role['roleID'],$role)) {
|
||||
show_json(LNG('success'),true,$role['roleID']);
|
||||
}
|
||||
show_json(LNG('error'),false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit(){
|
||||
$role = $this->_initData();
|
||||
$roleId = $this->in['roleID'];
|
||||
$this->_checkExist( $this->sql->get(),array('name',$role['name']),$roleId );
|
||||
if ($this->sql->set($roleId,$role)){
|
||||
show_json(LNG('success'),true,$roleId);
|
||||
}
|
||||
show_json(LNG('error'),false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del() {
|
||||
if (!isset($this->in['roleID'])) show_json(LNG('data_not_full'),false);
|
||||
if (strlen($this->in['roleID']) <= 1) show_json(LNG('default_user_can_not_do'),false);
|
||||
systemMember::roleRemoveUserUpdate($this->in['roleID']);//用户所在权限组变更
|
||||
if($this->sql->remove($this->in['roleID'])){
|
||||
show_json(LNG('success'));
|
||||
}
|
||||
show_json(LNG('error'),false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户组权限列表配置
|
||||
* 增删改查
|
||||
*/
|
||||
public function roleGroupAction(){
|
||||
$sql = new FileCache(USER_SYSTEM.'system_role_group.php');
|
||||
switch ($this->in['action']) {
|
||||
case 'get':
|
||||
$roleGroup = $sql->get();
|
||||
if($roleGroup['1']['name'] == 'read'){
|
||||
$roleGroup['1']['name'] = LNG('system_role_read');
|
||||
}
|
||||
if($roleGroup['2']['name'] == 'write'){
|
||||
$roleGroup['2']['name'] = LNG('system_role_write');
|
||||
}
|
||||
show_json($roleGroup,true,$this->config['pathRoleDefine']);
|
||||
break;
|
||||
case 'add':
|
||||
$roleId = $sql->getMaxId().'';
|
||||
$roleArr = json_decode($this->in['role_arr'],true);
|
||||
if(!is_array($roleArr)) show_json(LNG('error'),false);
|
||||
if(!trim($roleArr['name'])) show_json(LNG("data_not_full"),false);
|
||||
$this->_checkExist( $sql->get(),array('name',$roleArr['name']),$roleId);
|
||||
if ($sql->set($roleId,$roleArr)) {
|
||||
show_json(array($roleId),true,$sql->get());
|
||||
}
|
||||
show_json(LNG('error'),false);
|
||||
break;
|
||||
case 'set':
|
||||
$roleId = $this->in['roleID'];
|
||||
$roleArr = json_decode($this->in['role_arr'],true);
|
||||
if(!is_array($roleArr)) show_json(LNG('error'),false);
|
||||
if(!trim($roleArr['name'])) show_json(LNG("data_not_full"),false);
|
||||
$this->_checkExist( $sql->get(),array('name',$roleArr['name']),$roleId);
|
||||
if ($sql->set($roleId,$roleArr)){
|
||||
show_json(LNG('success'),true,$sql->get());
|
||||
}
|
||||
show_json(LNG('error'),false);
|
||||
break;
|
||||
case 'del':
|
||||
$roleId = $this->in['roleID'];
|
||||
if(in_array($roleId,array("1","2"))){
|
||||
show_json(LNG('default_user_can_not_do'),false);
|
||||
}
|
||||
if($sql->remove($this->in['roleID'])){
|
||||
show_json(LNG('success'),true,$sql->get());
|
||||
}
|
||||
show_json(LNG('error'),false);
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
|
||||
//检测是否存在
|
||||
private function _checkExist($data,$find,$checkID){
|
||||
$findData = array();
|
||||
foreach ($data as $key => $val) {
|
||||
if ($val[$find[0]] == $find[1]) {
|
||||
$findData[$key] = $data[$key];
|
||||
}
|
||||
}
|
||||
if(is_array($findData) && count($findData)>0 ){
|
||||
$key = array_keys($findData);$key=$key[0];
|
||||
if($key != $checkID) show_json(LNG("error_repeat"),false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//===========内部调用============
|
||||
/**
|
||||
* 初始化数据 get
|
||||
* 只传键即可 &extNotAllow='php,jsp'&explorer.mkfile=1&explorer.pathRname=1
|
||||
*/
|
||||
private function _initData(){
|
||||
if (strlen($this->in['name'])<1) show_json(LNG('groupname_can_not_null'),false);
|
||||
$roleArr = array(
|
||||
'name' => rawurldecode($this->in['name']),
|
||||
'extNotAllow' => $this->in['extNotAllow']
|
||||
);
|
||||
foreach ($this->config['roleSetting'] as $key => $actions) {
|
||||
foreach ($actions as $action) {
|
||||
$keyUrl = $key.'_'.$action;//url explorer.mkdir => explorer_mkdir;
|
||||
$keyAuth = $key.'.'.$action;
|
||||
if (isset($this->in[$keyUrl])){
|
||||
$roleArr[$keyAuth] = 1;
|
||||
}else{
|
||||
$roleArr[$keyAuth] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $roleArr;
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,106 @@
|
||||
<?php
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
|
||||
/**
|
||||
* 程序路由处理类
|
||||
* 这里类判断外界参数调用内部方法
|
||||
*/
|
||||
class Application {
|
||||
private $defaultController = null; //默认的类名
|
||||
private $defaultAction = null; //默认的方法名
|
||||
public $subDir =''; //控制器子目录
|
||||
public $model = ''; //控制器对应模型 对象。
|
||||
|
||||
/**
|
||||
* 设置默认的类名
|
||||
* @param string $defaultController
|
||||
*/
|
||||
public function setDefaultController($defaultController){
|
||||
$this -> defaultController = $defaultController;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置默认的方法名
|
||||
* @param string $defaultAction
|
||||
*/
|
||||
public function setDefaultAction($defaultAction){
|
||||
$this -> defaultAction = $defaultAction;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置控制器子目录
|
||||
* @param string $dir
|
||||
*/
|
||||
public function setSubDir($dir){
|
||||
$this -> subDir = $dir;
|
||||
}
|
||||
|
||||
/**
|
||||
* 运行controller 的方法
|
||||
* @param $class , controller类名。
|
||||
* @param $function , 方法名
|
||||
*/
|
||||
public function appRun($className,$function){
|
||||
$subDir = $this -> subDir ? $this -> subDir . '/' : '';
|
||||
$classFile = CONTROLLER_DIR . $subDir.$className.'.class.php';
|
||||
Hook::filter('Application.appRun',$classFile);
|
||||
if (!file_exists_case($classFile)) {
|
||||
show_tips($className.' controller '.LNG("not_exists"),APP_HOST,5);
|
||||
}
|
||||
|
||||
include_once($classFile);
|
||||
if (!class_exists($className)) {
|
||||
show_tips($className.' class '.LNG("not_exists"),APP_HOST,5);
|
||||
}
|
||||
$instance = new $className();
|
||||
if (!method_exists($instance, $function)) {
|
||||
show_tips($function.' method '.LNG("not_exists"),APP_HOST,5);
|
||||
}
|
||||
return $instance -> $function();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运行自动加载的控制器
|
||||
*/
|
||||
private function autorun(){
|
||||
global $config;
|
||||
if (count($config['autorun']) > 0) {
|
||||
foreach ($config['autorun'] as $key => $var) {
|
||||
$this->appRun($var['controller'],$var['function']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用实际类和方式
|
||||
*/
|
||||
public function run(){
|
||||
$URI = $GLOBALS['in']['URLremote'];
|
||||
if (!isset($URI[0]) || $URI[0] == '') $URI[0] = $this->defaultController;
|
||||
if (!isset($URI[1]) || $URI[1] == '') $URI[1] = $this->defaultAction;
|
||||
|
||||
//需要校验权限的方法,统一大小写敏感;处理需要权限的方法
|
||||
$roleSetting = $GLOBALS['config']['roleSetting'];
|
||||
$st = $URI[0];
|
||||
$act = $URI[1];
|
||||
if (array_key_exists($st,$roleSetting) ){
|
||||
if( !in_array($act,$roleSetting[$st]) &&
|
||||
in_array_not_case($act,$roleSetting[$st])
|
||||
){
|
||||
show_tips($act.' action not exists!');
|
||||
}
|
||||
}
|
||||
|
||||
define('ST',$st);
|
||||
define('ACT',$act);
|
||||
//自动加载运行类。
|
||||
$this->autorun();
|
||||
$this->appRun(ST,ACT);
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
|
||||
/**
|
||||
* 控制器抽象类
|
||||
*/
|
||||
abstract class Controller {
|
||||
public $in;
|
||||
public $config; // 全局配置
|
||||
public $tpl; // 模板目录
|
||||
public $values; // 模板变量
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
function __construct(){
|
||||
global $in,$config;
|
||||
$this ->config = &$config;
|
||||
$this ->in = &$in;
|
||||
$this ->values['config'] = &$config;
|
||||
$this ->values['in'] = &$in;
|
||||
$this ->tpl = TEMPLATE.get_class($this).'/';
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载模型
|
||||
* @param string $class
|
||||
*/
|
||||
public function loadModel($class){
|
||||
$args = func_get_args();
|
||||
$this -> $class = call_user_func_array('init_model', $args);
|
||||
return $this -> $class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载类库文件
|
||||
* @param string $class
|
||||
*/
|
||||
public function loadClass($class){
|
||||
if (1 === func_num_args()) {
|
||||
$this -> $class = new $class;
|
||||
} else {
|
||||
$reflectionObj = new ReflectionClass($class);
|
||||
$args = func_get_args();
|
||||
array_shift($args);
|
||||
$this -> $class = $reflectionObj -> newInstanceArgs($args);
|
||||
}
|
||||
return $this -> $class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示模板
|
||||
*
|
||||
* TODO smarty
|
||||
* @param
|
||||
*/
|
||||
protected function assign($key,$value){
|
||||
$this->values[$key] = $value;
|
||||
}
|
||||
/**
|
||||
* 显示模板
|
||||
* @param
|
||||
*/
|
||||
protected function display($tplFile){
|
||||
ob_end_clean();
|
||||
extract($this->values);
|
||||
require($this->tpl.$tplFile);
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
|
||||
/**
|
||||
* 模型抽象类
|
||||
* 一个关于各种模型的基本行为类,每个模型都必须继承这个类的方法
|
||||
*/
|
||||
|
||||
abstract class Model {
|
||||
var $db = null;
|
||||
var $in;
|
||||
var $config;
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
* @return Null
|
||||
*/
|
||||
function __construct(){
|
||||
global $config, $in;
|
||||
$this -> in = &$in;
|
||||
$this -> config = &$config;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO db
|
||||
*/
|
||||
function db(){
|
||||
if ($this ->db != NULL) {
|
||||
return $this ->db;
|
||||
}else{
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
$desktopApps = array(
|
||||
'my_computer' => array(
|
||||
"type" => "app",
|
||||
"content" => "core.explorer('','".LNG('my_computer')."');",
|
||||
"icon" => STATIC_PATH."images/file_icon/icon_others/computer.png",
|
||||
"name" => LNG('my_computer'),
|
||||
"menuType" => "systemBox menu-default",
|
||||
"ext" => 'oexe',
|
||||
"path" => "",
|
||||
"resize" => 1
|
||||
),
|
||||
'recycle' => array(
|
||||
"type" => "app",
|
||||
"content" => "core.explorer('".KOD_USER_RECYCLE."','".LNG('recycle')."');",
|
||||
"icon" => STATIC_PATH."images/file_icon/icon_others/recycle.png",
|
||||
"name" => LNG('recycle'),
|
||||
"menuType" => "systemBox menu-recycle-button",
|
||||
"ext" => 'oexe',
|
||||
"path" => "",
|
||||
"resize" => 1
|
||||
),
|
||||
'PluginCenter' => array(
|
||||
"type" => "app",
|
||||
"content" => "core.openWindowBig('./index.php?pluginApp/index','".LNG('PluginCenter')."');",
|
||||
"icon" => STATIC_PATH."images/file_icon/icon_others/plugins.png",
|
||||
"name" => LNG('PluginCenter'),
|
||||
"menuType" => "systemBox menu-default",
|
||||
"ext" => 'oexe',
|
||||
"path" => "",
|
||||
"resize" => 1
|
||||
),
|
||||
'setting' => array(
|
||||
"type" => "app",
|
||||
"content" => "core.setting();",
|
||||
"icon" => STATIC_PATH."images/file_icon/icon_others/setting.png",
|
||||
"name" => LNG('setting'),
|
||||
"menuType" => "systemBox menu-default",
|
||||
"ext" => 'oexe',
|
||||
"path" => "/",
|
||||
"resize" => 1
|
||||
),
|
||||
'appStore' => array(
|
||||
"type" => "app",
|
||||
"content" => "core.appStore();",
|
||||
"icon" => STATIC_PATH."images/file_icon/icon_others/appStore.png",
|
||||
"name" => LNG('app_store'),
|
||||
"menuType" => "systemBox menu-default",
|
||||
"ext" => 'oexe',
|
||||
"path" => "",
|
||||
"resize" => 1
|
||||
)
|
||||
);
|
||||
|
||||
//管理员插件中心
|
||||
if(!$GLOBALS['isRoot']){
|
||||
unset($desktopApps['PluginCenter']);
|
||||
}
|
||||
return $desktopApps;
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,788 @@
|
||||
<?php
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Converts to and from JSON format.
|
||||
*
|
||||
* JSON (JavaScript Object Notation) is a lightweight data-interchange
|
||||
* format. It is easy for humans to read and write. It is easy for machines
|
||||
* to parse and generate. It is based on a subset of the JavaScript
|
||||
* Programming Language, Standard ECMA-262 3rd Edition - December 1999.
|
||||
* This feature can also be found in Python. JSON is a text format that is
|
||||
* completely language independent but uses conventions that are familiar
|
||||
* to programmers of the C-family of languages, including C, C++, C#, Java,
|
||||
* JavaScript, Perl, TCL, and many others. These properties make JSON an
|
||||
* ideal data-interchange language.
|
||||
*
|
||||
* This package provides a simple encoder and decoder for JSON notation. It
|
||||
* is intended for use with client-side Javascript applications that make
|
||||
* use of HTTPRequest to perform server communication functions - data can
|
||||
* be encoded into JSON notation for use in a client-side javascript, or
|
||||
* decoded from incoming Javascript requests. JSON format is native to
|
||||
* Javascript, and can be directly eval()'ed with no further parsing
|
||||
* overhead
|
||||
*
|
||||
* All strings should be in ASCII or UTF-8 format!
|
||||
*
|
||||
* LICENSE: Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met: Redistributions of source code must retain the
|
||||
* above copyright notice, this list of conditions and the following
|
||||
* disclaimer. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following disclaimer
|
||||
* in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*
|
||||
* @category
|
||||
* @package Services_JSON
|
||||
* @author Michal Migurski <mike-json@teczno.com>
|
||||
* @author Matt Knapp <mdknapp[at]gmail[dot]com>
|
||||
* @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
|
||||
* @copyright 2005 Michal Migurski
|
||||
* @version CVS: $Id: JSON.php,v 1.31 2006/06/28 05:54:17 migurski Exp $
|
||||
* @license http://www.opensource.org/licenses/bsd-license.php
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198
|
||||
*/
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_SLICE', 1);
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_IN_STR', 2);
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_IN_ARR', 3);
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_IN_OBJ', 4);
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_IN_CMT', 5);
|
||||
|
||||
/**
|
||||
* Behavior switch for Services_JSON::decode()
|
||||
*/
|
||||
define('SERVICES_JSON_LOOSE_TYPE', 16);
|
||||
|
||||
/**
|
||||
* Behavior switch for Services_JSON::decode()
|
||||
*/
|
||||
define('SERVICES_JSON_SUPPRESS_ERRORS', 32);
|
||||
|
||||
/**
|
||||
* Converts to and from JSON format.
|
||||
*
|
||||
* Brief example of use:
|
||||
*
|
||||
* <code>
|
||||
* // create a new instance of Services_JSON
|
||||
* $json = new Services_JSON();
|
||||
*
|
||||
* // convert a complexe value to JSON notation, and send it to the browser
|
||||
* $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4)));
|
||||
* $output = $json->encode($value);
|
||||
*
|
||||
* print($output);
|
||||
* // prints: ["foo","bar",[1,2,"baz"],[3,[4]]]
|
||||
*
|
||||
* // accept incoming POST data, assumed to be in JSON notation
|
||||
* $input = file_get_contents('php://input', 1000000);
|
||||
* $value = $json->decode($input);
|
||||
* </code>
|
||||
*/
|
||||
class Services_JSON
|
||||
{
|
||||
/**
|
||||
* constructs a new JSON instance
|
||||
*
|
||||
* @param int $use object behavior flags; combine with boolean-OR
|
||||
*
|
||||
* possible values:
|
||||
* - SERVICES_JSON_LOOSE_TYPE: loose typing.
|
||||
* "{...}" syntax creates associative arrays
|
||||
* instead of objects in decode().
|
||||
* - SERVICES_JSON_SUPPRESS_ERRORS: error suppression.
|
||||
* Values which can't be encoded (e.g. resources)
|
||||
* appear as NULL instead of throwing errors.
|
||||
* By default, a deeply-nested resource will
|
||||
* bubble up with an error, so all return values
|
||||
* from encode() should be checked with isError()
|
||||
*/
|
||||
function __construct($use = 0)
|
||||
{
|
||||
$this->use = $use;
|
||||
}
|
||||
|
||||
/**
|
||||
* convert a string from one UTF-16 char to one UTF-8 char
|
||||
*
|
||||
* Normally should be handled by mb_convert_encoding, but
|
||||
* provides a slower PHP-only method for installations
|
||||
* that lack the multibye string extension.
|
||||
*
|
||||
* @param string $utf16 UTF-16 character
|
||||
* @return string UTF-8 character
|
||||
* @access private
|
||||
*/
|
||||
function utf162utf8($utf16)
|
||||
{
|
||||
// oh please oh please oh please oh please oh please
|
||||
if(function_exists('mb_convert_encoding')) {
|
||||
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
|
||||
}
|
||||
|
||||
$bytes = (ord($utf16[0]) << 8) | ord($utf16[1]);
|
||||
|
||||
switch(true) {
|
||||
case ((0x7F & $bytes) == $bytes):
|
||||
// this case should never be reached, because we are in ASCII range
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr(0x7F & $bytes);
|
||||
|
||||
case (0x07FF & $bytes) == $bytes:
|
||||
// return a 2-byte UTF-8 character
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr(0xC0 | (($bytes >> 6) & 0x1F))
|
||||
. chr(0x80 | ($bytes & 0x3F));
|
||||
|
||||
case (0xFFFF & $bytes) == $bytes:
|
||||
// return a 3-byte UTF-8 character
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr(0xE0 | (($bytes >> 12) & 0x0F))
|
||||
. chr(0x80 | (($bytes >> 6) & 0x3F))
|
||||
. chr(0x80 | ($bytes & 0x3F));
|
||||
}
|
||||
|
||||
// ignoring UTF-32 for now, sorry
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* convert a string from one UTF-8 char to one UTF-16 char
|
||||
*
|
||||
* Normally should be handled by mb_convert_encoding, but
|
||||
* provides a slower PHP-only method for installations
|
||||
* that lack the multibye string extension.
|
||||
*
|
||||
* @param string $utf8 UTF-8 character
|
||||
* @return string UTF-16 character
|
||||
* @access private
|
||||
*/
|
||||
function utf82utf16($utf8)
|
||||
{
|
||||
// oh please oh please oh please oh please oh please
|
||||
if(function_exists('mb_convert_encoding')) {
|
||||
return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
|
||||
}
|
||||
|
||||
switch(strlen($utf8)) {
|
||||
case 1:
|
||||
// this case should never be reached, because we are in ASCII range
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return $utf8;
|
||||
|
||||
case 2:
|
||||
// return a UTF-16 character from a 2-byte UTF-8 char
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr(0x07 & (ord($utf8[0]) >> 2))
|
||||
. chr((0xC0 & (ord($utf8[0]) << 6))
|
||||
| (0x3F & ord($utf8[1])));
|
||||
|
||||
case 3:
|
||||
// return a UTF-16 character from a 3-byte UTF-8 char
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr((0xF0 & (ord($utf8[0]) << 4))
|
||||
| (0x0F & (ord($utf8[1]) >> 2)))
|
||||
. chr((0xC0 & (ord($utf8[1]) << 6))
|
||||
| (0x7F & ord($utf8[2])));
|
||||
}
|
||||
|
||||
// ignoring UTF-32 for now, sorry
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* encodes an arbitrary variable into JSON format
|
||||
*
|
||||
* @param mixed $var any number, boolean, string, array, or object to be encoded.
|
||||
* see argument 1 to Services_JSON() above for array-parsing behavior.
|
||||
* if var is a strng, note that encode() always expects it
|
||||
* to be in ASCII or UTF-8 format!
|
||||
*
|
||||
* @return mixed JSON string representation of input var or an error if a problem occurs
|
||||
* @access public
|
||||
*/
|
||||
function encode($var)
|
||||
{
|
||||
switch (gettype($var)) {
|
||||
case 'boolean':
|
||||
return $var ? 'true' : 'false';
|
||||
|
||||
case 'NULL':
|
||||
return 'null';
|
||||
|
||||
case 'integer':
|
||||
return (int) $var;
|
||||
|
||||
case 'double':
|
||||
case 'float':
|
||||
return (float) $var;
|
||||
|
||||
case 'string':
|
||||
// STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT
|
||||
$ascii = '';
|
||||
$strlen_var = strlen($var);
|
||||
|
||||
/*
|
||||
* Iterate over every character in the string,
|
||||
* escaping with a slash or encoding to UTF-8 where necessary
|
||||
*/
|
||||
for ($c = 0; $c < $strlen_var; ++$c) {
|
||||
|
||||
$ord_var_c = ord($var{$c});
|
||||
|
||||
switch (true) {
|
||||
case $ord_var_c == 0x08:
|
||||
$ascii .= '\b';
|
||||
break;
|
||||
case $ord_var_c == 0x09:
|
||||
$ascii .= '\t';
|
||||
break;
|
||||
case $ord_var_c == 0x0A:
|
||||
$ascii .= '\n';
|
||||
break;
|
||||
case $ord_var_c == 0x0C:
|
||||
$ascii .= '\f';
|
||||
break;
|
||||
case $ord_var_c == 0x0D:
|
||||
$ascii .= '\r';
|
||||
break;
|
||||
|
||||
case $ord_var_c == 0x22:
|
||||
case $ord_var_c == 0x2F:
|
||||
case $ord_var_c == 0x5C:
|
||||
// double quote, slash, slosh
|
||||
$ascii .= '\\'.$var{$c};
|
||||
break;
|
||||
|
||||
case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
|
||||
// characters U-00000000 - U-0000007F (same as ASCII)
|
||||
$ascii .= $var{$c};
|
||||
break;
|
||||
|
||||
case (($ord_var_c & 0xE0) == 0xC0):
|
||||
// characters U-00000080 - U-000007FF, mask 110XXXXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c, ord($var{$c + 1}));
|
||||
$c += 1;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
break;
|
||||
|
||||
case (($ord_var_c & 0xF0) == 0xE0):
|
||||
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}));
|
||||
$c += 2;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
break;
|
||||
|
||||
case (($ord_var_c & 0xF8) == 0xF0):
|
||||
// characters U-00010000 - U-001FFFFF, mask 11110XXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}),
|
||||
ord($var{$c + 3}));
|
||||
$c += 3;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
break;
|
||||
|
||||
case (($ord_var_c & 0xFC) == 0xF8):
|
||||
// characters U-00200000 - U-03FFFFFF, mask 111110XX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}),
|
||||
ord($var{$c + 3}),
|
||||
ord($var{$c + 4}));
|
||||
$c += 4;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
break;
|
||||
|
||||
case (($ord_var_c & 0xFE) == 0xFC):
|
||||
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}),
|
||||
ord($var{$c + 3}),
|
||||
ord($var{$c + 4}),
|
||||
ord($var{$c + 5}));
|
||||
$c += 5;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return '"'.$ascii.'"';
|
||||
|
||||
case 'array':
|
||||
/*
|
||||
* As per JSON spec if any array key is not an integer
|
||||
* we must treat the the whole array as an object. We
|
||||
* also try to catch a sparsely populated associative
|
||||
* array with numeric keys here because some JS engines
|
||||
* will create an array with empty indexes up to
|
||||
* max_index which can cause memory issues and because
|
||||
* the keys, which may be relevant, will be remapped
|
||||
* otherwise.
|
||||
*
|
||||
* As per the ECMA and JSON specification an object may
|
||||
* have any string as a property. Unfortunately due to
|
||||
* a hole in the ECMA specification if the key is a
|
||||
* ECMA reserved word or starts with a digit the
|
||||
* parameter is only accessible using ECMAScript's
|
||||
* bracket notation.
|
||||
*/
|
||||
|
||||
// treat as a JSON object
|
||||
if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
|
||||
$properties = array_map(array($this, 'name_value'),
|
||||
array_keys($var),
|
||||
array_values($var));
|
||||
|
||||
foreach($properties as $property) {
|
||||
if(Services_JSON::isError($property)) {
|
||||
return $property;
|
||||
}
|
||||
}
|
||||
|
||||
return '{' . join(',', $properties) . '}';
|
||||
}
|
||||
|
||||
// treat it like a regular array
|
||||
$elements = array_map(array($this, 'encode'), $var);
|
||||
|
||||
foreach($elements as $element) {
|
||||
if(Services_JSON::isError($element)) {
|
||||
return $element;
|
||||
}
|
||||
}
|
||||
|
||||
return '[' . join(',', $elements) . ']';
|
||||
|
||||
case 'object':
|
||||
$vars = get_object_vars($var);
|
||||
|
||||
$properties = array_map(array($this, 'name_value'),
|
||||
array_keys($vars),
|
||||
array_values($vars));
|
||||
|
||||
foreach($properties as $property) {
|
||||
if(Services_JSON::isError($property)) {
|
||||
return $property;
|
||||
}
|
||||
}
|
||||
|
||||
return '{' . join(',', $properties) . '}';
|
||||
|
||||
default:
|
||||
return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
|
||||
? 'null'
|
||||
: new Services_JSON_Error(gettype($var)." can not be encoded as JSON string");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* array-walking function for use in generating JSON-formatted name-value pairs
|
||||
*
|
||||
* @param string $name name of key to use
|
||||
* @param mixed $value reference to an array element to be encoded
|
||||
*
|
||||
* @return string JSON-formatted name-value pair, like '"name":value'
|
||||
* @access private
|
||||
*/
|
||||
function name_value($name, $value)
|
||||
{
|
||||
$encoded_value = $this->encode($value);
|
||||
|
||||
if(Services_JSON::isError($encoded_value)) {
|
||||
return $encoded_value;
|
||||
}
|
||||
|
||||
return $this->encode(strval($name)) . ':' . $encoded_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* reduce a string by removing leading and trailing comments and whitespace
|
||||
*
|
||||
* @param $str string string value to strip of comments and whitespace
|
||||
*
|
||||
* @return string string value stripped of comments and whitespace
|
||||
* @access private
|
||||
*/
|
||||
function reduce_string($str){
|
||||
$str = preg_replace(array(
|
||||
|
||||
// eliminate single line comments in '// ...' form
|
||||
'#^\s*//(.+)$#m',
|
||||
|
||||
// eliminate multi-line comments in '/* ... */' form, at start of string
|
||||
'#^\s*/\*(.+)\*/#Us',
|
||||
|
||||
// eliminate multi-line comments in '/* ... */' form, at end of string
|
||||
'#/\*(.+)\*/\s*$#Us'
|
||||
|
||||
), '', $str);
|
||||
|
||||
// eliminate extraneous space
|
||||
return trim($str);
|
||||
}
|
||||
|
||||
/**
|
||||
* decodes a JSON string into appropriate variable
|
||||
*
|
||||
* @param string $str JSON-formatted string
|
||||
*
|
||||
* @return mixed number, boolean, string, array, or object
|
||||
* corresponding to given JSON input string.
|
||||
* See argument 1 to Services_JSON() above for object-output behavior.
|
||||
* Note that decode() always returns strings
|
||||
* in ASCII or UTF-8 format!
|
||||
* @access public
|
||||
*/
|
||||
function decode($str)
|
||||
{
|
||||
$str = $this->reduce_string($str);
|
||||
|
||||
switch (strtolower($str)) {
|
||||
case 'true':
|
||||
return true;
|
||||
|
||||
case 'false':
|
||||
return false;
|
||||
|
||||
case 'null':
|
||||
return null;
|
||||
|
||||
default:
|
||||
$m = array();
|
||||
|
||||
if (is_numeric($str)) {
|
||||
// Lookie-loo, it's a number
|
||||
|
||||
// This would work on its own, but I'm trying to be
|
||||
// good about returning integers where appropriate:
|
||||
// return (float)$str;
|
||||
|
||||
// Return float or int, as appropriate
|
||||
return ((float)$str == (integer)$str)
|
||||
? (integer)$str
|
||||
: (float)$str;
|
||||
|
||||
} elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) {
|
||||
// STRINGS RETURNED IN UTF-8 FORMAT
|
||||
$delim = substr($str, 0, 1);
|
||||
$chrs = substr($str, 1, -1);
|
||||
$utf8 = '';
|
||||
$strlen_chrs = strlen($chrs);
|
||||
|
||||
for ($c = 0; $c < $strlen_chrs; ++$c) {
|
||||
|
||||
$substr_chrs_c_2 = substr($chrs, $c, 2);
|
||||
$ord_chrs_c = ord($chrs{$c});
|
||||
|
||||
switch (true) {
|
||||
case $substr_chrs_c_2 == '\b':
|
||||
$utf8 .= chr(0x08);
|
||||
++$c;
|
||||
break;
|
||||
case $substr_chrs_c_2 == '\t':
|
||||
$utf8 .= chr(0x09);
|
||||
++$c;
|
||||
break;
|
||||
case $substr_chrs_c_2 == '\n':
|
||||
$utf8 .= chr(0x0A);
|
||||
++$c;
|
||||
break;
|
||||
case $substr_chrs_c_2 == '\f':
|
||||
$utf8 .= chr(0x0C);
|
||||
++$c;
|
||||
break;
|
||||
case $substr_chrs_c_2 == '\r':
|
||||
$utf8 .= chr(0x0D);
|
||||
++$c;
|
||||
break;
|
||||
|
||||
case $substr_chrs_c_2 == '\\"':
|
||||
case $substr_chrs_c_2 == '\\\'':
|
||||
case $substr_chrs_c_2 == '\\\\':
|
||||
case $substr_chrs_c_2 == '\\/':
|
||||
if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
|
||||
($delim == "'" && $substr_chrs_c_2 != '\\"')) {
|
||||
$utf8 .= $chrs{++$c};
|
||||
}
|
||||
break;
|
||||
|
||||
case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):
|
||||
// single, escaped unicode character
|
||||
$utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))
|
||||
. chr(hexdec(substr($chrs, ($c + 4), 2)));
|
||||
$utf8 .= $this->utf162utf8($utf16);
|
||||
$c += 5;
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
|
||||
$utf8 .= $chrs{$c};
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c & 0xE0) == 0xC0:
|
||||
// characters U-00000080 - U-000007FF, mask 110XXXXX
|
||||
//see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$utf8 .= substr($chrs, $c, 2);
|
||||
++$c;
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c & 0xF0) == 0xE0:
|
||||
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$utf8 .= substr($chrs, $c, 3);
|
||||
$c += 2;
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c & 0xF8) == 0xF0:
|
||||
// characters U-00010000 - U-001FFFFF, mask 11110XXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$utf8 .= substr($chrs, $c, 4);
|
||||
$c += 3;
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c & 0xFC) == 0xF8:
|
||||
// characters U-00200000 - U-03FFFFFF, mask 111110XX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$utf8 .= substr($chrs, $c, 5);
|
||||
$c += 4;
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c & 0xFE) == 0xFC:
|
||||
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$utf8 .= substr($chrs, $c, 6);
|
||||
$c += 5;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $utf8;
|
||||
|
||||
} elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
|
||||
// array, or object notation
|
||||
|
||||
if ($str[0]== '[') {
|
||||
$stk = array(SERVICES_JSON_IN_ARR);
|
||||
$arr = array();
|
||||
} else {
|
||||
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
|
||||
$stk = array(SERVICES_JSON_IN_OBJ);
|
||||
$obj = array();
|
||||
} else {
|
||||
$stk = array(SERVICES_JSON_IN_OBJ);
|
||||
$obj = new stdClass();
|
||||
}
|
||||
}
|
||||
|
||||
array_push($stk, array('what' => SERVICES_JSON_SLICE,
|
||||
'where' => 0,
|
||||
'delim' => false));
|
||||
|
||||
$chrs = substr($str, 1, -1);
|
||||
$chrs = $this->reduce_string($chrs);
|
||||
|
||||
if ($chrs == '') {
|
||||
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
||||
return $arr;
|
||||
|
||||
} else {
|
||||
return $obj;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//print("\nparsing {$chrs}\n");
|
||||
|
||||
$strlen_chrs = strlen($chrs);
|
||||
|
||||
for ($c = 0; $c <= $strlen_chrs; ++$c) {
|
||||
|
||||
$top = end($stk);
|
||||
$substr_chrs_c_2 = substr($chrs, $c, 2);
|
||||
|
||||
if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
|
||||
// found a comma that is not inside a string, array, etc.,
|
||||
// OR we've reached the end of the character list
|
||||
$slice = substr($chrs, $top['where'], ($c - $top['where']));
|
||||
array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));
|
||||
//print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
|
||||
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
||||
// we are in an array, so just push an element onto the stack
|
||||
array_push($arr, $this->decode($slice));
|
||||
|
||||
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
|
||||
// we are in an object, so figure
|
||||
// out the property name and set an
|
||||
// element in an associative array,
|
||||
// for now
|
||||
$parts = array();
|
||||
|
||||
if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
|
||||
// "name":value pair
|
||||
$key = $this->decode($parts[1]);
|
||||
$val = $this->decode($parts[2]);
|
||||
|
||||
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
|
||||
$obj[$key] = $val;
|
||||
} else {
|
||||
$obj->$key = $val;
|
||||
}
|
||||
} elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
|
||||
// name:value pair, where name is unquoted
|
||||
$key = $parts[1];
|
||||
$val = $this->decode($parts[2]);
|
||||
|
||||
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
|
||||
$obj[$key] = $val;
|
||||
} else {
|
||||
$obj->$key = $val;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
|
||||
// found a quote, and we are not inside a string
|
||||
array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
|
||||
//print("Found start of string at {$c}\n");
|
||||
|
||||
} elseif (($chrs{$c} == $top['delim']) &&
|
||||
($top['what'] == SERVICES_JSON_IN_STR) &&
|
||||
((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
|
||||
// found a quote, we're in a string, and it's not escaped
|
||||
// we know that it's not escaped becase there is _not_ an
|
||||
// odd number of backslashes at the end of the string so far
|
||||
array_pop($stk);
|
||||
//print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
|
||||
|
||||
} elseif (($chrs{$c} == '[') &&
|
||||
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
||||
// found a left-bracket, and we are in an array, object, or slice
|
||||
array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
|
||||
//print("Found start of array at {$c}\n");
|
||||
|
||||
} elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
|
||||
// found a right-bracket, and we're in an array
|
||||
array_pop($stk);
|
||||
//print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
|
||||
} elseif (($chrs{$c} == '{') &&
|
||||
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
||||
// found a left-brace, and we are in an array, object, or slice
|
||||
array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
|
||||
//print("Found start of object at {$c}\n");
|
||||
|
||||
} elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
|
||||
// found a right-brace, and we're in an object
|
||||
array_pop($stk);
|
||||
//print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
|
||||
} elseif (($substr_chrs_c_2 == '/*') &&
|
||||
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
||||
// found a comment start, and we are in an array, object, or slice
|
||||
array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));
|
||||
$c++;
|
||||
//print("Found start of comment at {$c}\n");
|
||||
|
||||
} elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {
|
||||
// found a comment end, and we're in one now
|
||||
array_pop($stk);
|
||||
$c++;
|
||||
|
||||
for ($i = $top['where']; $i <= $c; ++$i)
|
||||
$chrs = substr_replace($chrs, ' ', $i, 1);
|
||||
|
||||
//print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
||||
return $arr;
|
||||
|
||||
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
|
||||
return $obj;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo Ultimately, this should just call PEAR::isError()
|
||||
*/
|
||||
function isError($data, $code = null){
|
||||
if (class_exists('pear')) {
|
||||
return PEAR::isError($data, $code);
|
||||
} elseif (is_object($data) && (get_class($data) == 'services_json_error' ||
|
||||
is_subclass_of($data, 'services_json_error'))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('PEAR_Error')) {
|
||||
class Services_JSON_Error extends PEAR_Error{
|
||||
function __construct($message = 'unknown error', $code = null,
|
||||
$mode = null, $options = null, $userinfo = null){
|
||||
parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
class Services_JSON_Error{
|
||||
function __construct($message = 'unknown error', $code = null,
|
||||
$mode = null, $options = null, $userinfo = null){
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,170 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
|
||||
class Downloader {
|
||||
static function start($url,$saveFile,$timeout = 10) {
|
||||
$dataFile = $saveFile . '.download.cfg';
|
||||
$saveTemp = $saveFile . '.downloading';
|
||||
|
||||
//header:{'url','length','name','supportRange'}
|
||||
if(is_array($url)){
|
||||
$fileHeader = $url;
|
||||
}else{
|
||||
$fileHeader = url_header($url);
|
||||
}
|
||||
$url = $fileHeader['url'];
|
||||
if(!$url){
|
||||
return array('code'=>false,'data'=>'url error!');
|
||||
}
|
||||
//默认下载方式if not support range
|
||||
if(!$fileHeader['supportRange'] ||
|
||||
$fileHeader['length'] == 0 ){
|
||||
@unlink($saveTemp);@unlink($saveFile);
|
||||
$result = self::fileDownloadFopen($url,$saveFile,$fileHeader['length']);
|
||||
if($result['code']) {
|
||||
return $result;
|
||||
}else{
|
||||
@unlink($saveTemp);@unlink($saveFile);
|
||||
$result = self::fileDownloadCurl($url,$saveFile,false,0,$fileHeader['length']);
|
||||
@unlink($saveTemp);@unlink($saveFile);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
$existsLength = is_file($saveTemp) ? filesize($saveTemp) : 0;
|
||||
$contentLength = intval($fileHeader['length']);
|
||||
if( file_exists($saveTemp) &&
|
||||
time() - filemtime($saveTemp) < 3) {//has Changed in 3s,is downloading
|
||||
return array('code'=>false,'data'=>'downloading');
|
||||
}
|
||||
|
||||
$existsData = array();
|
||||
if(is_file($dataFile)){
|
||||
$tempData = file_get_contents($dataFile);
|
||||
$existsData = json_decode($tempData, 1);
|
||||
}
|
||||
// exist and is the same file;
|
||||
if( file_exists($saveFile) && $contentLength == filesize($saveFile)){
|
||||
@unlink($saveTemp);
|
||||
@unlink($dataFile);
|
||||
return array('code'=>true,'data'=>'exist');
|
||||
}
|
||||
|
||||
// check file is expire
|
||||
if ($existsData['length'] != $contentLength) {
|
||||
$existsData = array('length' => $contentLength);
|
||||
}
|
||||
if($existsLength > $contentLength){
|
||||
@unlink($saveTemp);
|
||||
}
|
||||
// write exists data
|
||||
file_put_contents($dataFile, json_encode($existsData));
|
||||
$result = self::fileDownloadCurl($url,$saveFile,true,$existsLength,$contentLength);
|
||||
if($result['code']){
|
||||
@unlink($dataFile);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
// fopen then download
|
||||
static function fileDownloadFopen($url, $fileName,$headerSize=0){
|
||||
@ini_set('user_agent','Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36');
|
||||
|
||||
$fileTemp = $fileName.'.downloading';
|
||||
@set_time_limit(0);
|
||||
@unlink($fileTemp);
|
||||
if ($fp = @fopen ($url, "rb")){
|
||||
if(!$downloadFp = @fopen($fileTemp, "wb")){
|
||||
return array('code'=>false,'data'=>'open_downloading_error');
|
||||
}
|
||||
while(!feof($fp)){
|
||||
if(!file_exists($fileTemp)){//删除目标文件;则终止下载
|
||||
fclose($downloadFp);
|
||||
return array('code'=>false,'data'=>'stoped');
|
||||
}
|
||||
//对于部分fp不结束的通过文件大小判断
|
||||
clearstatcache();
|
||||
if( $headerSize>0 &&
|
||||
$headerSize==get_filesize(iconv_system($fileTemp))
|
||||
){
|
||||
break;
|
||||
}
|
||||
fwrite($downloadFp, fread($fp, 1024 * 8 ), 1024 * 8);
|
||||
}
|
||||
//下载完成,重命名临时文件到目标文件
|
||||
fclose($downloadFp);
|
||||
fclose($fp);
|
||||
self::checkGzip($fileTemp);
|
||||
if(!@rename($fileTemp,$fileName)){
|
||||
usleep(round(rand(0,1000)*50));//0.01~10ms
|
||||
@unlink($fileName);
|
||||
$res = @rename($fileTemp,$fileName);
|
||||
if(!$res){
|
||||
return array('code'=>false,'data'=>'rename error![open]');
|
||||
}
|
||||
}
|
||||
return array('code'=>true,'data'=>'success');
|
||||
}else{
|
||||
return array('code'=>false,'data'=>'url_open_error');
|
||||
}
|
||||
}
|
||||
|
||||
// curl 方式下载
|
||||
// 断点续传 http://www.linuxidc.com/Linux/2014-10/107508.htm
|
||||
static function fileDownloadCurl($url, $fileName,$supportRange=false,$existsLength=0,$length=0){
|
||||
$fileTemp = $fileName.'.downloading';
|
||||
@set_time_limit(0);
|
||||
if ($fp = @fopen ($fileTemp, "a")){
|
||||
$ch = curl_init($url);
|
||||
//断点续传
|
||||
if($supportRange){
|
||||
curl_setopt($ch, CURLOPT_RANGE, $existsLength."-");
|
||||
}
|
||||
curl_setopt($ch, CURLOPT_FILE, $fp);
|
||||
curl_setopt($ch, CURLOPT_REFERER,get_url_link($url));
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36');
|
||||
|
||||
$res = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
fclose($fp);
|
||||
|
||||
$filesize = get_filesize(iconv_system($fileTemp));
|
||||
if($filesize < $length && $length!=0){
|
||||
return array('code'=>false,'data'=>'downloading');
|
||||
}
|
||||
if($res && filesize($fileTemp) != 0){
|
||||
self::checkGzip($fileTemp);
|
||||
if(!@rename($fileTemp,$fileName)){
|
||||
@unlink($fileName);
|
||||
$res = @rename($fileTemp,$fileName);
|
||||
if(!$res){
|
||||
return array('code'=>false,'data'=>'rename error![curl]');
|
||||
}
|
||||
}
|
||||
return array('code'=>true,'data'=>'success');
|
||||
}
|
||||
return array('code'=>false,'data'=>'curl exec error!');
|
||||
}else{
|
||||
return array('code'=>false,'data'=>'file create error');
|
||||
}
|
||||
}
|
||||
|
||||
static function checkGzip($file){
|
||||
$char = "\x1f\x8b";
|
||||
$str = file_sub_str($file,0,2);
|
||||
if($char != $str) return;
|
||||
|
||||
ob_start();
|
||||
readgzfile($file);
|
||||
$out = ob_get_clean();
|
||||
file_put_contents($file,$out);
|
||||
}
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
|
||||
/**
|
||||
* hook::add('function','function')
|
||||
* hook::add('class:function','class.function')
|
||||
*
|
||||
* hook::run('class.function',param)
|
||||
* hook::run('function',param)
|
||||
*
|
||||
*/
|
||||
|
||||
class Hook{
|
||||
static private $events = array();
|
||||
static public function get($event=false){
|
||||
if(!$event){
|
||||
return self::$events;
|
||||
}else{
|
||||
return self::$events[$event];
|
||||
}
|
||||
}
|
||||
static public function apply($action,$args=array()) {
|
||||
if(!is_string($action)){
|
||||
return;
|
||||
}
|
||||
if(strstr($action,'.')){
|
||||
$arr = explode('.',$action);
|
||||
if(count($arr) !== 2){
|
||||
return;
|
||||
}
|
||||
$className = $arr[0];
|
||||
$functionName = $arr[1];
|
||||
if(class_exists($className)){
|
||||
$class = new $className();
|
||||
if( method_exists($class,$functionName) ){
|
||||
//return $class -> $functionName($args);
|
||||
return @call_user_func_array(array($class,$functionName), $args);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(function_exists($action)){
|
||||
return @call_user_func_array($action, $args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static public function bind($event,$action,$once=false) {
|
||||
if(!isset(self::$events[$event])){
|
||||
self::$events[$event] = array();
|
||||
}
|
||||
if(!is_array($action)){
|
||||
$action = array($action);
|
||||
}
|
||||
for ($i=0; $i < count($action); $i++) {
|
||||
self::$events[$event][] = array(
|
||||
'action' => $action[$i],
|
||||
'once' => $once,
|
||||
'times' => 0
|
||||
);
|
||||
}
|
||||
}
|
||||
static public function once($event,$action) {
|
||||
self::bind($event,$action,true);
|
||||
}
|
||||
static public function unbind($event) {
|
||||
self::$events[$event] = false;
|
||||
}
|
||||
|
||||
//数据处理;只支持传入一个参数
|
||||
static public function filter($event,&$param) {
|
||||
$result = self::trigger($event,$param);
|
||||
if($result){
|
||||
$param = $result;
|
||||
}
|
||||
}
|
||||
static public function trigger($event) {
|
||||
$events = self::$events;
|
||||
if( !isset($events[$event]) ){
|
||||
return;
|
||||
}
|
||||
$actions = $events[$event];
|
||||
$result = false;
|
||||
if(is_array($actions) && count($actions) >= 1) {
|
||||
$args = func_get_args();
|
||||
array_shift($args);
|
||||
for ($i=0; $i < count($actions); $i++) {
|
||||
$action = $actions[$i];
|
||||
if( $action['once'] && $action['times'] > 1){
|
||||
continue;
|
||||
}
|
||||
|
||||
if(defined("GLOBAL_DEBUG_HOOK") && GLOBAL_DEBUG_HOOK){
|
||||
write_log($event.'==>start: '.$action['action'],'hook-trigger');
|
||||
}
|
||||
|
||||
self::$events[$event][$i]['times'] = $action['times'] + 1;
|
||||
$res = self::apply($action['action'],$args);
|
||||
|
||||
if(defined("GLOBAL_DEBUG_HOOK") && GLOBAL_DEBUG_HOOK){
|
||||
write_log($event.'==>end['.$action['times'].']: '.$action['action'],'hook-trigger');
|
||||
}
|
||||
//避免循环调用
|
||||
if( $action['times'] >= 5000){
|
||||
show_json("ERROR,Too many trigger on:".$event.'==>'.$action['action'],fasle);
|
||||
}
|
||||
if(!is_null($res)){
|
||||
$result = $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
function LNG($key){
|
||||
if (func_num_args() == 1) {
|
||||
return I18n::get($key);
|
||||
} else {
|
||||
$args = func_get_args();
|
||||
array_shift($args);
|
||||
return vsprintf(I18n::get($key), $args);
|
||||
}
|
||||
}
|
||||
|
||||
class I18n{
|
||||
private static $loaded = false;
|
||||
private static $lang = NULL;
|
||||
public static $langType = NULL;
|
||||
|
||||
public static function defaultLang(){
|
||||
if(isset($GLOBALS['config']['settings']['language'])){
|
||||
return $GLOBALS['config']['settings']['language'];
|
||||
}
|
||||
$lang = "en";
|
||||
$arr = $GLOBALS['config']['settingAll']['language'];
|
||||
$langs = array();
|
||||
if(!$arr) return 'zh-CN';
|
||||
foreach ($arr as $key => $value) {
|
||||
$langs[$key] = $key;
|
||||
}
|
||||
$langs['zh'] = 'zh-CN'; //增加大小写对应关系
|
||||
$langs['zh-tw'] = 'zh-TW';
|
||||
|
||||
$acceptLanguage = array();
|
||||
if(!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
||||
$httpLang = 'en';
|
||||
}else{
|
||||
$httpLang = str_replace("_","-",strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']));
|
||||
}
|
||||
preg_match_all('~([-a-z]+)(;q=([0-9.]+))?~',$httpLang,$matches,PREG_SET_ORDER);
|
||||
foreach ($matches as $match) {
|
||||
$acceptLanguage[$match[1]] = (isset($match[3]) ? $match[3] : 1);
|
||||
}
|
||||
arsort($acceptLanguage);
|
||||
foreach ($acceptLanguage as $key => $q) {
|
||||
if (isset($langs[$key])) {
|
||||
$lang = $langs[$key];break;
|
||||
}
|
||||
$key = preg_replace('~-.*~','', $key);
|
||||
if (!isset($acceptLanguage[$key]) && isset($langs[$key])) {
|
||||
$lang = $langs[$key];break;
|
||||
}
|
||||
}
|
||||
return $lang;
|
||||
}
|
||||
|
||||
public static function getAll(){
|
||||
self::init();
|
||||
return self::$lang;
|
||||
}
|
||||
public static function getType(){
|
||||
self::init();
|
||||
return self::$langType;
|
||||
}
|
||||
|
||||
public static function init(){
|
||||
if(self::$loaded !== false){
|
||||
return;
|
||||
}
|
||||
$cookieLang = 'kodUserLanguage';
|
||||
if (isset($_COOKIE[$cookieLang])) {
|
||||
$lang = $_COOKIE[$cookieLang];
|
||||
}else{
|
||||
$lang = self::defaultLang();
|
||||
//setcookie_header($cookieLang,$lang, time()+3600*24*100);
|
||||
}
|
||||
|
||||
$lang = str_replace(array('/','\\','..','.'),'',$lang);
|
||||
//兼容旧版本
|
||||
if($lang == 'zh_CN') $lang = 'zh-CN';
|
||||
if($lang == 'zh_TW') $lang = 'zh-TW';
|
||||
|
||||
if(isset($GLOBALS['config']['settings']['language'])){
|
||||
$lang = $GLOBALS['config']['settings']['language'];
|
||||
}
|
||||
$langFile = LANGUAGE_PATH.$lang.'/main.php';
|
||||
if(!file_exists($langFile)){//allow remove some I18n folder
|
||||
$lang = 'en';
|
||||
$langFile = LANGUAGE_PATH.$lang.'/main.php';
|
||||
}
|
||||
|
||||
self::$langType = $lang;
|
||||
self::$lang = include($langFile);
|
||||
self::$loaded = true;
|
||||
$GLOBALS['L'] = self::$lang;
|
||||
}
|
||||
|
||||
public static function get($key){
|
||||
self::init();
|
||||
if(!isset(self::$lang[$key])){
|
||||
return $key;
|
||||
}
|
||||
if (func_num_args() == 1) {
|
||||
return self::$lang[$key];
|
||||
} else {
|
||||
$args = func_get_args();
|
||||
array_shift($args);
|
||||
return vsprintf(self::$lang[$key], $args);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加多语言;
|
||||
* @param [type] $args [description]
|
||||
*/
|
||||
public static function set($array){
|
||||
self::init();
|
||||
if(!is_array($array)) return;
|
||||
foreach ($array as $key => $value) {
|
||||
self::$lang[$key] = $value;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,332 @@
|
||||
<?php
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
|
||||
|
||||
define('ARCHIVE_LIB',dirname(__FILE__).'/archiveLib/');
|
||||
define('PCLZIP_TEMPORARY_DIR',TEMP_PATH);
|
||||
define('PCLTAR_TEMPORARY_DIR',TEMP_PATH);
|
||||
define('PCLZIP_SEPARATOR',';@@@,');//压缩多个文件,组成字符串分割
|
||||
mk_dir(TEMP_PATH);
|
||||
|
||||
require_once ARCHIVE_LIB.'pclerror.lib.php';
|
||||
require_once ARCHIVE_LIB.'pcltrace.lib.php';
|
||||
require_once ARCHIVE_LIB.'pcltar.lib.php';
|
||||
require_once ARCHIVE_LIB.'pclzip.class.php';
|
||||
require_once ARCHIVE_LIB.'kodRarArchive.class.php';
|
||||
require_once ARCHIVE_LIB.'kodZipArchive.class.php';
|
||||
|
||||
class KodArchive {
|
||||
/**
|
||||
* [checkIfType get the app by ext]
|
||||
* @param [type] $guess [check]
|
||||
* @param [type] $ext [file ext]
|
||||
* @return [type] [description]
|
||||
*/
|
||||
static function checkIfType($ext,$appType){
|
||||
$extArray = array(
|
||||
'zip' => array('zip','ipa','apk','epub'),
|
||||
'tar' => array('tar','tar.gz','tgz','gz'),
|
||||
'rar' => array('rar','7z','xz','bz2','arj','cab','iso')
|
||||
);
|
||||
$result = in_array($ext,$extArray[$appType]);
|
||||
if( $result &&
|
||||
($appType == 'zip' || $appType == 'tar') &&
|
||||
(!function_exists('gzopen') || !function_exists('gzinflate'))
|
||||
){
|
||||
show_tips("[Error] Can't Open; Missing zlib extensions");
|
||||
}
|
||||
|
||||
if( $result && $appType == 'rar' &&
|
||||
(!function_exists('shell_exec') || !strstr(shell_exec('echo "kodcloud"'),'kodcloud'))
|
||||
){
|
||||
show_tips("[Error] Can't Open; shell_exec Can't use");
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* [listContent description]
|
||||
* @param [type] $file [archive file]
|
||||
* @return [type] [array or false]
|
||||
*/
|
||||
static function listContent($file,$output=true) {
|
||||
$ext = get_path_ext($file);
|
||||
$result = false;
|
||||
if( self::checkIfType($ext,'tar') ){
|
||||
//TrOn(10);
|
||||
$resultOld = PclTarList($file);
|
||||
//TrDisplay();exit;
|
||||
$result = array();
|
||||
for ($i=0; $i < count($resultOld); $i++) {
|
||||
$item = $resultOld[$i];
|
||||
//http://rpm5.org/docs/api/tar_8c-source.html
|
||||
if( $item['typeflag'] == 'x' || $item['typeflag'] == 'g'){
|
||||
continue;
|
||||
}
|
||||
if($output){
|
||||
$item['filename'] = ltrim($item['filename'],'./');
|
||||
}
|
||||
if($item['typeflag'] == '5'){
|
||||
$item['folder'] = true;
|
||||
}else{
|
||||
$item['folder'] = false;
|
||||
}
|
||||
$item['index'] = $i;
|
||||
$result[] = $item;
|
||||
}
|
||||
}else if( self::checkIfType($ext,'rar') ){
|
||||
$appResult = kodRarArchive::listContent($file);
|
||||
if(!$appResult['code']){
|
||||
return $appResult;
|
||||
}else{
|
||||
$result = $appResult['data'];
|
||||
}
|
||||
}else{//默认zip
|
||||
if(kodZipArchive::support('list')){
|
||||
$result = kodZipArchive::listContent($file);
|
||||
}else{
|
||||
$zip = new PclZip($file);
|
||||
$result = $zip->listContent();
|
||||
}
|
||||
}
|
||||
if($result){
|
||||
//编码转换
|
||||
$charset = unzip_charset_get($result);
|
||||
$output = $output && function_exists('iconv');
|
||||
for ($i=0; $i < count($result); $i++) {
|
||||
//不允许相对路径
|
||||
$result[$i]['filename'] = str_replace(array('../','..\\'),"_",$result[$i]['filename']);
|
||||
// $charset = get_charset($result[$i]['filename']);
|
||||
if($output){
|
||||
$result[$i]['filename'] = iconv_to($result[$i]['filename'],$charset,'utf-8');
|
||||
unset($result[$i]['stored_filename']);
|
||||
}
|
||||
}
|
||||
return array('code'=>true,'data'=>$result);
|
||||
}else{
|
||||
return array('code'=>false,'data'=>$result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [extract description]
|
||||
* @param [type] $file [archive file]
|
||||
* @param [type] $dest [extract to folder]
|
||||
* @param string $part [archive file content]
|
||||
* @return [type] [array]
|
||||
*/
|
||||
static function extract($file, $dest, $part = '-1',&$partName=false) {
|
||||
$ext = get_path_ext($file);
|
||||
$listContent = self::listContent($file,false);//不转码
|
||||
if(!$listContent['code']){
|
||||
return $listContent;
|
||||
}
|
||||
if($part != '-1'){//解压部分.则构造 $pathRemove $indexPath
|
||||
$indexInfo = self::fileIndex($listContent['data'],$part);
|
||||
$partName = str_replace(array('../','..\\'),'_',$indexInfo['filename']);
|
||||
$indexPath = $partName;
|
||||
if($GLOBALS['config']['systemCharset'] != 'utf-8'){
|
||||
$indexPath = unzip_pre_name($partName);//系统编码
|
||||
}
|
||||
|
||||
//$pathRemove = get_path_father($indexPath);
|
||||
$pathRemove = get_path_father($partName);//中文情况文件情况兼容
|
||||
|
||||
if($indexInfo['folder']){
|
||||
$indexPath = rtrim($indexPath,'/').'/';//tar 解压文件夹需要/结尾
|
||||
$partName = array($partName);
|
||||
}
|
||||
|
||||
$tempCheck = str_replace('\\','/',$indexPath);
|
||||
if(substr($tempCheck,-1) == '/'){
|
||||
//跟目录;需要追加一层文件夹;window a\b\c\ linux a/b/c/
|
||||
if( !strstr(trim($tempCheck,'/'),'/') ){
|
||||
$dest = $dest.unzip_pre_name(get_path_this($tempCheck)).'/';
|
||||
}
|
||||
}else{
|
||||
if($pathRemove == $indexPath){//根目录文件;
|
||||
$pathRemove = '';
|
||||
}
|
||||
}
|
||||
//debug_out($indexInfo,$indexPath,$partName,$pathRemove,$tempCheck);
|
||||
}
|
||||
|
||||
if( self::checkIfType($ext,'tar') ){
|
||||
//TrOn(10);
|
||||
if($part != '-1'){
|
||||
//tar 默认都进行转码;
|
||||
$indexPath = unzip_pre_name($indexPath);
|
||||
$pathRemove = unzip_pre_name($pathRemove);
|
||||
$result = PclTarExtractList($file,array($indexPath),$dest,$pathRemove);
|
||||
}else{
|
||||
$result = PclTarExtract($file,$dest);
|
||||
}
|
||||
//TrDisplay();exit;
|
||||
return array('code'=>$result,'data'=>PclErrorString(true));
|
||||
}else if( self::checkIfType($ext,'rar')){ // || $ext == 'zip'
|
||||
return kodRarArchive::extract($file,$dest,$ext,$partName);
|
||||
}else if(kodZipArchive::support('extract')){
|
||||
return kodZipArchive::extract($file,$dest,$partName);
|
||||
}else{
|
||||
$zip = new PclZip($file);
|
||||
//解压内部的一部分,按文件名或文件夹来
|
||||
if($part != '-1'){
|
||||
$result = $zip->extract(PCLZIP_OPT_PATH,$dest,
|
||||
PCLZIP_OPT_SET_CHMOD,DEFAULT_PERRMISSIONS,
|
||||
PCLZIP_CB_PRE_FILE_NAME,'unzip_pre_name',
|
||||
|
||||
PCLZIP_OPT_BY_NAME,$indexInfo['filename'],
|
||||
PCLZIP_OPT_REMOVE_PATH,$pathRemove,
|
||||
PCLZIP_OPT_REPLACE_NEWER);
|
||||
}else{
|
||||
$result = $zip->extract(PCLZIP_OPT_PATH,$dest,
|
||||
PCLZIP_OPT_SET_CHMOD,DEFAULT_PERRMISSIONS,
|
||||
PCLZIP_CB_PRE_FILE_NAME,'unzip_pre_name',
|
||||
PCLZIP_OPT_REPLACE_NEWER);//解压到某个地方,覆盖方式
|
||||
}
|
||||
return array('code'=>$result,'data'=>$zip->errorName(true));
|
||||
}
|
||||
return array('code'=>false,'data'=>'File Type Not Support');
|
||||
}
|
||||
|
||||
static function fileIndex($list,$index,$key=false){
|
||||
if(!is_array($list)) return false;
|
||||
$len = count($list);
|
||||
for ($i=0; $i < $len; $i++) {
|
||||
if($index == $list[$i]['index']){
|
||||
$item = $list[$i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!$item){
|
||||
show_tips('KodArchive:fileIndex; index error;file not exists!');
|
||||
}
|
||||
$result = $item;
|
||||
if($key){
|
||||
$result = $item[$key];
|
||||
if($item['folder']){
|
||||
$result = rtrim($result,'/').'/';//tar 解压文件夹需要结尾/
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
static function extractZipFile($file,$byName,$cacheName = false){
|
||||
$temp = TEMP_PATH.'archivePreview/'.hash_path($file).'/';
|
||||
mk_dir($temp);
|
||||
touch(TEMP_PATH.'archivePreview/index.html');
|
||||
$newFile = $temp.md5($file.$byName);
|
||||
if($cacheName){
|
||||
$newFile = $temp.$cacheName;
|
||||
}
|
||||
|
||||
if(file_exists($newFile)){
|
||||
return $newFile;
|
||||
}
|
||||
$zip = new PclZip($file);
|
||||
$outFile = unzip_filter_ext($temp.get_path_this($byName));
|
||||
$parent = get_path_father($byName);
|
||||
if($parent == $byName){
|
||||
$parent = '';
|
||||
}
|
||||
$result = $zip->extract(
|
||||
PCLZIP_OPT_PATH,$temp,
|
||||
PCLZIP_CB_PRE_FILE_NAME,'unzip_pre_name',
|
||||
PCLZIP_OPT_REMOVE_PATH,$parent,
|
||||
PCLZIP_OPT_BY_NAME,$byName);
|
||||
if(!file_exists($outFile)){
|
||||
return false;
|
||||
}
|
||||
@rename($outFile,$newFile);
|
||||
return $newFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* [filePreview file preview or download a file;]
|
||||
* 解压后自动缓存;
|
||||
* @param [type] $file [archive file name]
|
||||
* @param [type] $index [file index]
|
||||
* @return [type] [echo to client;]
|
||||
*/
|
||||
static function filePreview($file,$index,$download=false,$byName = false){
|
||||
$temp = TEMP_PATH.'archivePreview/'.hash_path($file).'/';
|
||||
mk_dir($temp);
|
||||
touch(TEMP_PATH.'archivePreview/index.html');
|
||||
$newFile = $temp.md5($file.$index.$byName);
|
||||
$partName = '';//引用传值,传入处理
|
||||
$result = self::extract($file, $temp,$index,$partName);
|
||||
if(is_array($partName)){//不能是数组——文件夹
|
||||
show_json('unzip preview folder error!',false);
|
||||
}
|
||||
if(file_exists($newFile)){
|
||||
file_put_out($newFile,$download,get_path_this($partName));
|
||||
return;
|
||||
}
|
||||
//$partName 压缩文件原名;初始编码;转为当前文件系统编码
|
||||
$partName = unzip_pre_name($partName);
|
||||
$filenameOutput = get_path_this($partName);
|
||||
$outFile = unzip_filter_ext($temp.$filenameOutput);
|
||||
if(!$result['code']){
|
||||
show_json($result['data'],false);
|
||||
}
|
||||
//debug_out($partName,$file,$outFile,$byName);
|
||||
if(!file_exists($outFile)){
|
||||
show_json('unzip error!',false);
|
||||
}
|
||||
@rename($outFile,$newFile);
|
||||
if(!file_exists($newFile)){
|
||||
del_dir($temp);
|
||||
show_json('unzip:rename error!');
|
||||
}
|
||||
file_put_out($newFile,$download,$filenameOutput);
|
||||
}
|
||||
/**
|
||||
* [create description]
|
||||
* @param [type] $file [archive file name]
|
||||
* @param [type] $files [files add;file or folders]
|
||||
* @return [type] [bool]
|
||||
*/
|
||||
static function create($file,$files) {
|
||||
$ext = get_path_ext($file);
|
||||
$result = false;
|
||||
if( self::checkIfType($ext,'zip') ){
|
||||
if(kodZipArchive::support('add')){
|
||||
return kodZipArchive::create($file,$files);
|
||||
}
|
||||
$archive = new PclZip($file);
|
||||
foreach ($files as $key =>$val) {
|
||||
$val = str_replace('//','/',$val);
|
||||
$removePathPre = _DIR_CLEAR(get_path_father($val));
|
||||
if($key == 0){
|
||||
$result = $archive->create($val,
|
||||
PCLZIP_OPT_REMOVE_PATH,$removePathPre,
|
||||
PCLZIP_CB_PRE_FILE_NAME,'zip_pre_name'
|
||||
);
|
||||
continue;
|
||||
}
|
||||
$result = $archive->add($val,
|
||||
PCLZIP_OPT_REMOVE_PATH,$removePathPre,
|
||||
PCLZIP_CB_PRE_FILE_NAME,'zip_pre_name'
|
||||
);
|
||||
}
|
||||
}else if( self::checkIfType($ext,'tar') ){
|
||||
//TrOn(10);
|
||||
foreach ($files as $key =>$val) {
|
||||
$val = str_replace('//','/',$val);
|
||||
$removePathPre = _DIR_CLEAR(get_path_father($val));
|
||||
if($key == 0){
|
||||
$result = PclTarCreate($file,array($val), $ext,null, $removePathPre);
|
||||
continue;
|
||||
}
|
||||
$result = PclTarAddList($file,array($val),'',$removePathPre,$ext);
|
||||
}
|
||||
//TrDisplay();exit;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,147 @@
|
||||
<?php
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
|
||||
// ZipArchive 解压缩
|
||||
class kodZipArchive{
|
||||
static $listCache = array();
|
||||
static function support($type=''){
|
||||
$result = false;
|
||||
if($type == 'extract' && defined("ZIP_ARCHIVE_LOCAL")){// 只允许创建压缩文件用系统调用
|
||||
$result = true;
|
||||
}
|
||||
if(!class_exists('ZipArchive')){
|
||||
$result = false;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
static function listContent($file){
|
||||
$file_hash = hash_path($file);
|
||||
if(isset(self::$listCache[$file_hash])){
|
||||
return self::$listCache[$file_hash];
|
||||
}
|
||||
$zip = new ZipArchive();
|
||||
$zip->open($file);
|
||||
$count = $zip->numFiles;
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$entry = $zip->statIndex($i);
|
||||
$filename = str_replace('\\', '/', $entry['name']);
|
||||
$result[] = array(
|
||||
'filename' => $entry['name'],
|
||||
'stored_filename' => $entry['name'],
|
||||
'size' => $entry['size'],
|
||||
'compressed_size' => $entry['comp_size'],
|
||||
'mtime' => $entry['mtime'],
|
||||
'index' => $i,
|
||||
'folder' => (substr($entry['name'], -1, 1) == '/'),
|
||||
'crc' => $entry['crc']
|
||||
);
|
||||
}
|
||||
self::$listCache[$file_hash] = $result;
|
||||
return $result;
|
||||
}
|
||||
/**
|
||||
* [extract description]
|
||||
* @param [type] $file [archive file]
|
||||
* @param [type] $dest [extract to folder]
|
||||
* @param string $part [archive file content]
|
||||
* @return [type] [array]
|
||||
*/
|
||||
static function extract($file,$dest,$partName=false) {
|
||||
$dest_before = $dest;
|
||||
$dest = TEMP_PATH.'archivePreview/'.md5(rand_string(40).time()).'/';
|
||||
mk_dir($dest);touch(TEMP_PATH.'archivePreview/index.html');
|
||||
|
||||
$zip = new ZipArchive();
|
||||
if(!$zip->open($file)){
|
||||
return array('code'=>false,'data'=>'Can not open zip file!');
|
||||
}
|
||||
|
||||
if($partName === false){
|
||||
$result = $zip->extractTo($dest);
|
||||
}else{
|
||||
if(!is_array($partName)){
|
||||
$partName = array($partName);
|
||||
}
|
||||
$matchFiles = $partName;
|
||||
//解压文件夹
|
||||
if(substr($partName[0], -1, 1) == '/'){
|
||||
$matchFiles = array();
|
||||
$list = self::listContent($file);
|
||||
foreach ($list as $item) {
|
||||
if ( strpos($item['filename'],$partName[0]) === 0 ) {
|
||||
$matchFiles[] = $item['filename'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$result = $zip->extractTo($dest,$matchFiles);
|
||||
}
|
||||
$zip->close();
|
||||
|
||||
//子目录解压移除多余层级目录
|
||||
if( is_array($partName) ){
|
||||
$thePath = trim(str_replace("\\",'/',$partName[0]),'/');
|
||||
$pathGroup = explode('/',$thePath);
|
||||
//一级目录解压不用移动
|
||||
if(count($pathGroup) > 1){
|
||||
move_path($dest.$partName[0],$dest.get_path_this($thePath));
|
||||
del_dir($dest.$pathGroup[0]);
|
||||
}else{
|
||||
$dest_before = get_path_father($dest_before);
|
||||
}
|
||||
}
|
||||
|
||||
//扩展名处理;文件名重命名处理
|
||||
$arr = dir_list($dest);
|
||||
foreach($arr as $f){
|
||||
$itemPath = str_replace(array($dest,"\\"),array('','/'),$f);
|
||||
$itemPath = unzip_pre_name($itemPath);
|
||||
$from = $dest.get_path_father($itemPath).get_path_this($f);
|
||||
if(strstr($itemPath,'/') == false){
|
||||
$from = $dest.get_path_this($f);
|
||||
}
|
||||
if($dest.$itemPath != $from){
|
||||
@rename($from,$dest.$itemPath);
|
||||
}
|
||||
}
|
||||
move_path($dest,$dest_before);
|
||||
del_dir(rtrim($dest,'/'));
|
||||
return array('code'=>$result,'data'=>$result);
|
||||
}
|
||||
|
||||
/**
|
||||
* [create description]
|
||||
* @param [type] $file [creat file to]
|
||||
* @param [type] $files [array from]
|
||||
* @return [type] [description]
|
||||
*/
|
||||
static function create($file,$files) {
|
||||
$zip = new ZipArchive();
|
||||
if(!$zip->open($file, ZipArchive::CREATE)){
|
||||
return false;//Can not open(create) zip file!'
|
||||
}
|
||||
foreach ($files as $key =>$val) {
|
||||
$val = str_replace(array('//','\\'),'/',$val);
|
||||
$removePathPre = _DIR_CLEAR(get_path_father($val));
|
||||
$list = array($val);
|
||||
if(is_dir($val)){
|
||||
$list = dir_list($val);
|
||||
$list[] = $val;
|
||||
}
|
||||
foreach ($list as $item) {
|
||||
$addName = zip_pre_name(str_replace($removePathPre,'',$item));
|
||||
if(is_dir($item)){
|
||||
$result = $zip->addEmptyDir($addName);
|
||||
}else{
|
||||
$result = $zip->addFile($item,$addName);
|
||||
}
|
||||
}
|
||||
}
|
||||
$zip->close();
|
||||
return $result;
|
||||
}
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
<?php
|
||||
// --------------------------------------------------------------------------------
|
||||
// PhpConcept Library (PCL) Error 1.0
|
||||
// --------------------------------------------------------------------------------
|
||||
// License GNU/GPL - Vincent Blavet - Mars 2001
|
||||
// http://www.phpconcept.net & http://phpconcept.free.fr
|
||||
// --------------------------------------------------------------------------------
|
||||
// Français :
|
||||
// La description de l'usage de la librairie PCL Error 1.0 n'est pas encore
|
||||
// disponible. Celle-ci n'est pour le moment distribuée qu'avec les
|
||||
// développements applicatifs de PhpConcept.
|
||||
// Une version indépendante sera bientot disponible sur http://www.phpconcept.net
|
||||
//
|
||||
// English :
|
||||
// The PCL Error 1.0 library description is not available yet. This library is
|
||||
// released only with PhpConcept application and libraries.
|
||||
// An independant release will be soon available on http://www.phpconcept.net
|
||||
//
|
||||
// --------------------------------------------------------------------------------
|
||||
//
|
||||
// * Avertissement :
|
||||
//
|
||||
// Cette librairie a été créée de façon non professionnelle.
|
||||
// Son usage est au risque et péril de celui qui l'utilise, en aucun cas l'auteur
|
||||
// de ce code ne pourra être tenu pour responsable des éventuels dégats qu'il pourrait
|
||||
// engendrer.
|
||||
// Il est entendu cependant que l'auteur a réalisé ce code par plaisir et n'y a
|
||||
// caché aucun virus, ni malveillance.
|
||||
// Cette libairie est distribuée sous la license GNU/GPL (http://www.gnu.org)
|
||||
//
|
||||
// * Auteur :
|
||||
//
|
||||
// Ce code a été écrit par Vincent Blavet (vincent@blavet.net) sur son temps
|
||||
// de loisir.
|
||||
//
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
// ----- Look for double include
|
||||
if (!defined("PCLERROR_LIB"))
|
||||
{
|
||||
define( "PCLERROR_LIB", 1 );
|
||||
|
||||
// ----- Version
|
||||
$g_pcl_error_version = "1.0";
|
||||
|
||||
// ----- Internal variables
|
||||
// These values must only be change by PclError library functions
|
||||
$g_pcl_error_string = "";
|
||||
$g_pcl_error_code = 1;
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// Function : PclErrorLog()
|
||||
// Description :
|
||||
// Parameters :
|
||||
// --------------------------------------------------------------------------------
|
||||
function PclErrorLog($p_error_code=0, $p_error_string="")
|
||||
{
|
||||
global $g_pcl_error_string;
|
||||
global $g_pcl_error_code;
|
||||
|
||||
$g_pcl_error_code = $p_error_code;
|
||||
$g_pcl_error_string = $p_error_string;
|
||||
|
||||
}
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// Function : PclErrorFatal()
|
||||
// Description :
|
||||
// Parameters :
|
||||
// --------------------------------------------------------------------------------
|
||||
function PclErrorFatal($p_file, $p_line, $p_error_string="")
|
||||
{
|
||||
global $g_pcl_error_string;
|
||||
global $g_pcl_error_code;
|
||||
|
||||
$v_message = "<html><body>";
|
||||
$v_message .= "<p align=center><font color=red bgcolor=white><b>PclError Library has detected a fatal error on file '$p_file', line $p_line</b></font></p>";
|
||||
$v_message .= "<p align=center><font color=red bgcolor=white><b>$p_error_string</b></font></p>";
|
||||
$v_message .= "</body></html>";
|
||||
die($v_message);
|
||||
}
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// Function : PclErrorReset()
|
||||
// Description :
|
||||
// Parameters :
|
||||
// --------------------------------------------------------------------------------
|
||||
function PclErrorReset()
|
||||
{
|
||||
global $g_pcl_error_string;
|
||||
global $g_pcl_error_code;
|
||||
|
||||
$g_pcl_error_code = 1;
|
||||
$g_pcl_error_string = "";
|
||||
}
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// Function : PclErrorCode()
|
||||
// Description :
|
||||
// Parameters :
|
||||
// --------------------------------------------------------------------------------
|
||||
function PclErrorCode()
|
||||
{
|
||||
global $g_pcl_error_string;
|
||||
global $g_pcl_error_code;
|
||||
|
||||
return($g_pcl_error_code);
|
||||
}
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// Function : PclErrorString()
|
||||
// Description :
|
||||
// Parameters :
|
||||
// --------------------------------------------------------------------------------
|
||||
function PclErrorString()
|
||||
{
|
||||
global $g_pcl_error_string;
|
||||
global $g_pcl_error_code;
|
||||
|
||||
return($g_pcl_error_string." [code $g_pcl_error_code]");
|
||||
}
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// ----- End of double include look
|
||||
}
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,453 @@
|
||||
<?php
|
||||
// --------------------------------------------------------------------------------
|
||||
// PhpConcept Library (PCL) Trace 1.0
|
||||
// --------------------------------------------------------------------------------
|
||||
// License GNU/GPL - Vincent Blavet - Janvier 2001
|
||||
// http://www.phpconcept.net & http://phpconcept.free.fr
|
||||
// --------------------------------------------------------------------------------
|
||||
// Français :
|
||||
// La description de l'usage de la librairie PCL Trace 1.0 n'est pas encore
|
||||
// disponible. Celle-ci n'est pour le moment distribuée qu'avec l'application
|
||||
// et la librairie PhpZip.
|
||||
// Une version indépendante sera bientot disponible sur http://www.phpconcept.net
|
||||
//
|
||||
// English :
|
||||
// The PCL Trace 1.0 library description is not available yet. This library is
|
||||
// released only with PhpZip application and library.
|
||||
// An independant release will be soon available on http://www.phpconcept.net
|
||||
//
|
||||
// --------------------------------------------------------------------------------
|
||||
//
|
||||
// * Avertissement :
|
||||
//
|
||||
// Cette librairie a été créée de façon non professionnelle.
|
||||
// Son usage est au risque et péril de celui qui l'utilise, en aucun cas l'auteur
|
||||
// de ce code ne pourra être tenu pour responsable des éventuels dégats qu'il pourrait
|
||||
// engendrer.
|
||||
// Il est entendu cependant que l'auteur a réalisé ce code par plaisir et n'y a
|
||||
// caché aucun virus, ni malveillance.
|
||||
// Cette libairie est distribuée sous la license GNU/GPL (http://www.gnu.org)
|
||||
//
|
||||
// * Auteur :
|
||||
//
|
||||
// Ce code a été écrit par Vincent Blavet (vincent@blavet.net) sur son temps
|
||||
// de loisir.
|
||||
//
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
// ----- Look for double include
|
||||
if (!defined("PCLTRACE_LIB"))
|
||||
{
|
||||
define( "PCLTRACE_LIB", 1 );
|
||||
|
||||
// ----- Version
|
||||
$g_pcl_trace_version = "1.0";
|
||||
|
||||
// ----- Internal variables
|
||||
// These values must be change by PclTrace library functions
|
||||
$g_pcl_trace_mode = "memory";
|
||||
$g_pcl_trace_filename = "trace.txt";
|
||||
$g_pcl_trace_name = array();
|
||||
$g_pcl_trace_index = 0;
|
||||
$g_pcl_trace_level = 10;
|
||||
$g_pcl_trace_entries = array();
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// Function : TrOn($p_level, $p_mode, $p_filename)
|
||||
// Description :
|
||||
// Parameters :
|
||||
// $p_level : Trace level
|
||||
// $p_mode : Mode of trace displaying :
|
||||
// 'normal' : messages are displayed at function call
|
||||
// 'memory' : messages are memorized in a table and can be display by
|
||||
// TrDisplay() function. (default)
|
||||
// 'log' : messages are writed in the file $p_filename
|
||||
// --------------------------------------------------------------------------------
|
||||
function TrOn($p_level=1, $p_mode="memory", $p_filename="trace.txt")
|
||||
{
|
||||
global $g_pcl_trace_level;
|
||||
global $g_pcl_trace_mode;
|
||||
global $g_pcl_trace_filename;
|
||||
global $g_pcl_trace_name;
|
||||
global $g_pcl_trace_index;
|
||||
global $g_pcl_trace_entries;
|
||||
|
||||
// ----- Enable trace mode
|
||||
$g_pcl_trace_level = $p_level;
|
||||
|
||||
// ----- Memorize mode and filename
|
||||
switch ($p_mode) {
|
||||
case "normal" :
|
||||
case "memory" :
|
||||
case "log" :
|
||||
$g_pcl_trace_mode = $p_mode;
|
||||
break;
|
||||
default :
|
||||
$g_pcl_trace_mode = "logged";
|
||||
}
|
||||
|
||||
// ----- Memorize filename
|
||||
$g_pcl_trace_filename = $p_filename;
|
||||
}
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// Function : IsTrOn()
|
||||
// Description :
|
||||
// Return value :
|
||||
// The trace level (0 for disable).
|
||||
// --------------------------------------------------------------------------------
|
||||
function IsTrOn()
|
||||
{
|
||||
global $g_pcl_trace_level;
|
||||
|
||||
return($g_pcl_trace_level);
|
||||
}
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// Function : TrOff()
|
||||
// Description :
|
||||
// Parameters :
|
||||
// --------------------------------------------------------------------------------
|
||||
function TrOff()
|
||||
{
|
||||
global $g_pcl_trace_level;
|
||||
global $g_pcl_trace_mode;
|
||||
global $g_pcl_trace_filename;
|
||||
global $g_pcl_trace_name;
|
||||
global $g_pcl_trace_index;
|
||||
|
||||
// ----- Clean
|
||||
$g_pcl_trace_mode = "memory";
|
||||
unset($g_pcl_trace_entries);
|
||||
unset($g_pcl_trace_name);
|
||||
unset($g_pcl_trace_index);
|
||||
|
||||
// ----- Switch off trace
|
||||
$g_pcl_trace_level = 0;
|
||||
}
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// Function : TrFctStart()
|
||||
// Description :
|
||||
// Just a trace function for debbugging purpose before I use a better tool !!!!
|
||||
// Start and stop of this function is by $g_pcl_trace_level global variable.
|
||||
// Parameters :
|
||||
// $p_level : Level of trace required.
|
||||
// --------------------------------------------------------------------------------
|
||||
function TrFctStart($p_file, $p_line, $p_name, $p_param="", $p_message="")
|
||||
{
|
||||
global $g_pcl_trace_level;
|
||||
global $g_pcl_trace_mode;
|
||||
global $g_pcl_trace_filename;
|
||||
global $g_pcl_trace_name;
|
||||
global $g_pcl_trace_index;
|
||||
global $g_pcl_trace_entries;
|
||||
|
||||
// ----- Look for disabled trace
|
||||
if ($g_pcl_trace_level < 1)
|
||||
return;
|
||||
|
||||
// ----- Add the function name in the list
|
||||
if (!isset($g_pcl_trace_name))
|
||||
$g_pcl_trace_name = $p_name;
|
||||
else
|
||||
$g_pcl_trace_name .= ",".$p_name;
|
||||
|
||||
// ----- Update the function entry
|
||||
$i = sizeof($g_pcl_trace_entries);
|
||||
$g_pcl_trace_entries[$i][name] = $p_name;
|
||||
$g_pcl_trace_entries[$i][param] = $p_param;
|
||||
$g_pcl_trace_entries[$i][message] = "";
|
||||
$g_pcl_trace_entries[$i][file] = $p_file;
|
||||
$g_pcl_trace_entries[$i][line] = $p_line;
|
||||
$g_pcl_trace_entries[$i][index] = $g_pcl_trace_index;
|
||||
$g_pcl_trace_entries[$i][type] = "1"; // means start of function
|
||||
|
||||
// ----- Update the message entry
|
||||
if ($p_message != "")
|
||||
{
|
||||
$i = sizeof($g_pcl_trace_entries);
|
||||
$g_pcl_trace_entries[$i][name] = "";
|
||||
$g_pcl_trace_entries[$i][param] = "";
|
||||
$g_pcl_trace_entries[$i][message] = $p_message;
|
||||
$g_pcl_trace_entries[$i][file] = $p_file;
|
||||
$g_pcl_trace_entries[$i][line] = $p_line;
|
||||
$g_pcl_trace_entries[$i][index] = $g_pcl_trace_index;
|
||||
$g_pcl_trace_entries[$i][type] = "3"; // means message
|
||||
}
|
||||
|
||||
// ----- Action depending on mode
|
||||
PclTraceAction($g_pcl_trace_entries[$i]);
|
||||
|
||||
// ----- Increment the index
|
||||
$g_pcl_trace_index++;
|
||||
}
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// Function : TrFctEnd()
|
||||
// Description :
|
||||
// Just a trace function for debbugging purpose before I use a better tool !!!!
|
||||
// Start and stop of this function is by $g_pcl_trace_level global variable.
|
||||
// Parameters :
|
||||
// $p_level : Level of trace required.
|
||||
// --------------------------------------------------------------------------------
|
||||
function TrFctEnd($p_file, $p_line, $p_return=1, $p_message="")
|
||||
{
|
||||
global $g_pcl_trace_level;
|
||||
global $g_pcl_trace_mode;
|
||||
global $g_pcl_trace_filename;
|
||||
global $g_pcl_trace_name;
|
||||
global $g_pcl_trace_index;
|
||||
global $g_pcl_trace_entries;
|
||||
|
||||
// ----- Look for disabled trace
|
||||
if ($g_pcl_trace_level < 1)
|
||||
return;
|
||||
|
||||
// ----- Extract the function name in the list
|
||||
// ----- Remove the function name in the list
|
||||
if (!($v_name = strrchr($g_pcl_trace_name, ",")))
|
||||
{
|
||||
$v_name = $g_pcl_trace_name;
|
||||
$g_pcl_trace_name = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
$g_pcl_trace_name = substr($g_pcl_trace_name, 0, strlen($g_pcl_trace_name)-strlen($v_name));
|
||||
$v_name = substr($v_name, -strlen($v_name)+1);
|
||||
}
|
||||
|
||||
// ----- Decrement the index
|
||||
$g_pcl_trace_index--;
|
||||
|
||||
// ----- Update the message entry
|
||||
if ($p_message != "")
|
||||
{
|
||||
$i = sizeof($g_pcl_trace_entries);
|
||||
$g_pcl_trace_entries[$i][name] = "";
|
||||
$g_pcl_trace_entries[$i][param] = "";
|
||||
$g_pcl_trace_entries[$i][message] = $p_message;
|
||||
$g_pcl_trace_entries[$i][file] = $p_file;
|
||||
$g_pcl_trace_entries[$i][line] = $p_line;
|
||||
$g_pcl_trace_entries[$i][index] = $g_pcl_trace_index;
|
||||
$g_pcl_trace_entries[$i][type] = "3"; // means message
|
||||
}
|
||||
|
||||
// ----- Update the function entry
|
||||
$i = sizeof($g_pcl_trace_entries);
|
||||
$g_pcl_trace_entries[$i][name] = $v_name;
|
||||
$g_pcl_trace_entries[$i][param] = $p_return;
|
||||
$g_pcl_trace_entries[$i][message] = "";
|
||||
$g_pcl_trace_entries[$i][file] = $p_file;
|
||||
$g_pcl_trace_entries[$i][line] = $p_line;
|
||||
$g_pcl_trace_entries[$i][index] = $g_pcl_trace_index;
|
||||
$g_pcl_trace_entries[$i][type] = "2"; // means end of function
|
||||
|
||||
// ----- Action depending on mode
|
||||
PclTraceAction($g_pcl_trace_entries[$i]);
|
||||
}
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// Function : TrFctMessage()
|
||||
// Description :
|
||||
// Parameters :
|
||||
// --------------------------------------------------------------------------------
|
||||
function TrFctMessage($p_file, $p_line, $p_level, $p_message="")
|
||||
{
|
||||
global $g_pcl_trace_level;
|
||||
global $g_pcl_trace_mode;
|
||||
global $g_pcl_trace_filename;
|
||||
global $g_pcl_trace_name;
|
||||
global $g_pcl_trace_index;
|
||||
global $g_pcl_trace_entries;
|
||||
|
||||
// ----- Look for disabled trace
|
||||
if ($g_pcl_trace_level < $p_level)
|
||||
return;
|
||||
|
||||
// ----- Update the entry
|
||||
$i = sizeof($g_pcl_trace_entries);
|
||||
$g_pcl_trace_entries[$i][name] = "";
|
||||
$g_pcl_trace_entries[$i][param] = "";
|
||||
$g_pcl_trace_entries[$i][message] = $p_message;
|
||||
$g_pcl_trace_entries[$i][file] = $p_file;
|
||||
$g_pcl_trace_entries[$i][line] = $p_line;
|
||||
$g_pcl_trace_entries[$i][index] = $g_pcl_trace_index;
|
||||
$g_pcl_trace_entries[$i][type] = "3"; // means message of function
|
||||
|
||||
// ----- Action depending on mode
|
||||
PclTraceAction($g_pcl_trace_entries[$i]);
|
||||
}
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// Function : TrMessage()
|
||||
// Description :
|
||||
// Parameters :
|
||||
// --------------------------------------------------------------------------------
|
||||
function TrMessage($p_file, $p_line, $p_level, $p_message="")
|
||||
{
|
||||
global $g_pcl_trace_level;
|
||||
global $g_pcl_trace_mode;
|
||||
global $g_pcl_trace_filename;
|
||||
global $g_pcl_trace_name;
|
||||
global $g_pcl_trace_index;
|
||||
global $g_pcl_trace_entries;
|
||||
|
||||
// ----- Look for disabled trace
|
||||
if ($g_pcl_trace_level < $p_level)
|
||||
return;
|
||||
|
||||
// ----- Update the entry
|
||||
$i = sizeof($g_pcl_trace_entries);
|
||||
$g_pcl_trace_entries[$i][name] = "";
|
||||
$g_pcl_trace_entries[$i][param] = "";
|
||||
$g_pcl_trace_entries[$i][message] = $p_message;
|
||||
$g_pcl_trace_entries[$i][file] = $p_file;
|
||||
$g_pcl_trace_entries[$i][line] = $p_line;
|
||||
$g_pcl_trace_entries[$i][index] = $g_pcl_trace_index;
|
||||
$g_pcl_trace_entries[$i][type] = "4"; // means simple message
|
||||
|
||||
// ----- Action depending on mode
|
||||
PclTraceAction($g_pcl_trace_entries[$i]);
|
||||
}
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// Function : TrDisplay()
|
||||
// Description :
|
||||
// Parameters :
|
||||
// --------------------------------------------------------------------------------
|
||||
function TrDisplay()
|
||||
{
|
||||
global $g_pcl_trace_level;
|
||||
global $g_pcl_trace_mode;
|
||||
global $g_pcl_trace_filename;
|
||||
global $g_pcl_trace_name;
|
||||
global $g_pcl_trace_index;
|
||||
global $g_pcl_trace_entries;
|
||||
|
||||
// ----- Look for disabled trace
|
||||
if (($g_pcl_trace_level <= 0) || ($g_pcl_trace_mode != "memory"))
|
||||
return;
|
||||
|
||||
$v_font = "\"Verdana, Arial, Helvetica, sans-serif\"";
|
||||
|
||||
// ----- Trace Header
|
||||
echo "<table width=100% border=0 cellspacing=0 cellpadding=0>";
|
||||
echo "<tr bgcolor=#0000CC>";
|
||||
echo "<td bgcolor=#0000CC width=1>";
|
||||
echo "</td>";
|
||||
echo "<td><div align=center><font size=3 color=#FFFFFF face=$v_font>Trace</font></div></td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td bgcolor=#0000CC width=1>";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
|
||||
// ----- Content header
|
||||
echo "<table width=100% border=0 cellspacing=0 cellpadding=0>";
|
||||
|
||||
// ----- Display
|
||||
$v_again=0;
|
||||
for ($i=0; $i<sizeof($g_pcl_trace_entries); $i++)
|
||||
{
|
||||
// ---- Row header
|
||||
echo "<tr>";
|
||||
echo "<td><table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
|
||||
$n = ($g_pcl_trace_entries[$i][index]+1)*10;
|
||||
echo "<td width=".$n."><table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
|
||||
|
||||
for ($j=0; $j<=$g_pcl_trace_entries[$i][index]; $j++)
|
||||
{
|
||||
if ($j==$g_pcl_trace_entries[$i][index])
|
||||
{
|
||||
if (($g_pcl_trace_entries[$i][type] == 1) || ($g_pcl_trace_entries[$i][type] == 2))
|
||||
echo "<td width=10><div align=center><font size=2 face=$v_font>+</font></div></td>";
|
||||
}
|
||||
else
|
||||
echo "<td width=10><div align=center><font size=2 face=$v_font>|</font></div></td>";
|
||||
}
|
||||
//echo "<td> </td>";
|
||||
echo "</tr></table></td>";
|
||||
|
||||
echo "<td width=2></td>";
|
||||
switch ($g_pcl_trace_entries[$i][type]) {
|
||||
case 1:
|
||||
echo "<td><font size=2 face=$v_font>".$g_pcl_trace_entries[$i][name]."(".$g_pcl_trace_entries[$i][param].")</font></td>";
|
||||
break;
|
||||
case 2:
|
||||
echo "<td><font size=2 face=$v_font>".$g_pcl_trace_entries[$i][name]."()=".$g_pcl_trace_entries[$i][param]."</font></td>";
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
echo "<td><table width=100% border=0 cellspacing=0 cellpadding=0><td width=20></td><td>";
|
||||
echo "<font size=2 face=$v_font>".$g_pcl_trace_entries[$i][message]."</font>";
|
||||
echo "</td></table></td>";
|
||||
break;
|
||||
default:
|
||||
echo "<td><font size=2 face=$v_font>".$g_pcl_trace_entries[$i][name]."(".$g_pcl_trace_entries[$i][param].")</font></td>";
|
||||
}
|
||||
echo "</tr></table></td>";
|
||||
echo "<td width=5></td>";
|
||||
echo "<td><font size=1 face=$v_font>".basename($g_pcl_trace_entries[$i][file])."</font></td>";
|
||||
echo "<td width=5></td>";
|
||||
echo "<td><font size=1 face=$v_font>".$g_pcl_trace_entries[$i][line]."</font></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
// ----- Content footer
|
||||
echo "</table>";
|
||||
|
||||
// ----- Trace footer
|
||||
echo "</td>";
|
||||
echo "<td bgcolor=#0000CC width=1>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr bgcolor=#0000CC>";
|
||||
echo "<td bgcolor=#0000CC width=1>";
|
||||
echo "</td>";
|
||||
echo "<td><div align=center><font color=#FFFFFF face=$v_font> </font></div></td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
}
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// Function : PclTraceAction()
|
||||
// Description :
|
||||
// Parameters :
|
||||
// --------------------------------------------------------------------------------
|
||||
function PclTraceAction($p_entry)
|
||||
{
|
||||
global $g_pcl_trace_level;
|
||||
global $g_pcl_trace_mode;
|
||||
global $g_pcl_trace_filename;
|
||||
global $g_pcl_trace_name;
|
||||
global $g_pcl_trace_index;
|
||||
global $g_pcl_trace_entries;
|
||||
|
||||
if ($g_pcl_trace_mode == "normal")
|
||||
{
|
||||
for ($i=0; $i<$p_entry[index]; $i++)
|
||||
echo "---";
|
||||
if ($p_entry[type] == 1)
|
||||
echo "<b>".$p_entry[name]."</b>(".$p_entry[param].") : ".$p_entry[message]." [".$p_entry[file].", ".$p_entry[line]."]<br>";
|
||||
else if ($p_entry[type] == 2)
|
||||
echo "<b>".$p_entry[name]."</b>()=".$p_entry[param]." : ".$p_entry[message]." [".$p_entry[file].", ".$p_entry[line]."]<br>";
|
||||
else
|
||||
echo $p_entry[message]." [".$p_entry[file].", ".$p_entry[line]."]<br>";
|
||||
}
|
||||
}
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
// ----- End of double include look
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,286 @@
|
||||
<?php
|
||||
// from elfinder;
|
||||
class imageGdBMP{
|
||||
public static function load($filename){
|
||||
$fp = fopen($filename, "rb");
|
||||
if ($fp === false){
|
||||
return false;
|
||||
}
|
||||
$bmp = self::loadFromStream($fp);
|
||||
fclose($fp);
|
||||
return $bmp;
|
||||
}
|
||||
public static function loadFromStream($stream){
|
||||
$buf = fread($stream, 14); //2+4+2+2+4
|
||||
if ($buf === false){
|
||||
return false;
|
||||
}
|
||||
if ($buf[0] != 'B' || $buf[1] != 'M'){
|
||||
return false;
|
||||
}
|
||||
$bitmapHeader = unpack(
|
||||
"vtype/".
|
||||
"Vsize/".
|
||||
"vreserved1/".
|
||||
"vreserved2/".
|
||||
"Voffbits", $buf
|
||||
);
|
||||
return self::loadFromStreamAndFileHeader($stream, $bitmapHeader);
|
||||
}
|
||||
public static function loadFromStreamAndFileHeader($stream, array $bitmapHeader){
|
||||
if ($bitmapHeader["type"] != 0x4d42){
|
||||
return false;
|
||||
}
|
||||
$buf = fread($stream, 4);
|
||||
if ($buf === false){
|
||||
return false;
|
||||
}
|
||||
list(,$header_size) = unpack("V", $buf);
|
||||
if ($header_size == 12){
|
||||
$buf = fread($stream, $header_size - 4);
|
||||
if ($buf === false){
|
||||
return false;
|
||||
}
|
||||
extract(unpack(
|
||||
"vwidth/".
|
||||
"vheight/".
|
||||
"vplanes/".
|
||||
"vbit_count", $buf
|
||||
));
|
||||
$clr_used = $clr_important = $alpha_mask = $compression = 0;
|
||||
$red_mask = 0x00ff0000;
|
||||
$green_mask = 0x0000ff00;
|
||||
$blue_mask = 0x000000ff;
|
||||
} else if (124 < $header_size || $header_size < 40) {
|
||||
return false;
|
||||
} else {
|
||||
$buf = fread($stream, 36);
|
||||
if ($buf === false){
|
||||
return false;
|
||||
}
|
||||
extract(unpack(
|
||||
"Vwidth/".
|
||||
"Vheight/".
|
||||
"vplanes/".
|
||||
"vbit_count/".
|
||||
"Vcompression/".
|
||||
"Vsize_image/".
|
||||
"Vx_pels_per_meter/".
|
||||
"Vy_pels_per_meter/".
|
||||
"Vclr_used/".
|
||||
"Vclr_important", $buf
|
||||
));
|
||||
if ($width & 0x80000000){ $width = -(~$width & 0xffffffff) - 1; }
|
||||
if ($height & 0x80000000){ $height = -(~$height & 0xffffffff) - 1; }
|
||||
if ($x_pels_per_meter & 0x80000000){ $x_pels_per_meter = -(~$x_pels_per_meter & 0xffffffff) - 1; }
|
||||
if ($y_pels_per_meter & 0x80000000){ $y_pels_per_meter = -(~$y_pels_per_meter & 0xffffffff) - 1; }
|
||||
if ($bitmapHeader["size"] != 0){
|
||||
$colorsize = $bit_count == 1 || $bit_count == 4 || $bit_count == 8 ? ($clr_used ? $clr_used : pow(2, $bit_count))<<2 : 0;
|
||||
$bodysize = $size_image ? $size_image : ((($width * $bit_count + 31) >> 3) & ~3) * abs($height);
|
||||
$calcsize = $bitmapHeader["size"] - $bodysize - $colorsize - 14;
|
||||
if ($header_size < $calcsize && 40 <= $header_size && $header_size <= 124){
|
||||
$header_size = $calcsize;
|
||||
}
|
||||
}
|
||||
if ($header_size - 40 > 0){
|
||||
$buf = fread($stream, $header_size - 40);
|
||||
if ($buf === false){
|
||||
return false;
|
||||
}
|
||||
extract(unpack(
|
||||
"Vred_mask/".
|
||||
"Vgreen_mask/".
|
||||
"Vblue_mask/".
|
||||
"Valpha_mask", $buf . str_repeat("\x00", 120)
|
||||
));
|
||||
} else {
|
||||
$alpha_mask = $red_mask = $green_mask = $blue_mask = 0;
|
||||
}
|
||||
if (
|
||||
($bit_count == 16 || $bit_count == 24 || $bit_count == 32)&&
|
||||
$compression == 0 &&
|
||||
$red_mask == 0 && $green_mask == 0 && $blue_mask == 0
|
||||
){
|
||||
switch($bit_count){
|
||||
case 16:
|
||||
$red_mask = 0x7c00;
|
||||
$green_mask = 0x03e0;
|
||||
$blue_mask = 0x001f;
|
||||
break;
|
||||
case 24:
|
||||
case 32:
|
||||
$red_mask = 0x00ff0000;
|
||||
$green_mask = 0x0000ff00;
|
||||
$blue_mask = 0x000000ff;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
($width == 0)||
|
||||
($height == 0)||
|
||||
($planes != 1)||
|
||||
(($alpha_mask & $red_mask ) != 0)||
|
||||
(($alpha_mask & $green_mask) != 0)||
|
||||
(($alpha_mask & $blue_mask ) != 0)||
|
||||
(($red_mask & $green_mask) != 0)||
|
||||
(($red_mask & $blue_mask ) != 0)||
|
||||
(($green_mask & $blue_mask ) != 0)
|
||||
){
|
||||
return false;
|
||||
}
|
||||
if ($compression == 4 || $compression == 5){
|
||||
$buf = stream_get_contents($stream, $size_image);
|
||||
if ($buf === false){
|
||||
return false;
|
||||
}
|
||||
return imagecreatefromstring($buf);
|
||||
}
|
||||
$line_bytes = (($width * $bit_count + 31) >> 3) & ~3;
|
||||
$lines = abs($height);
|
||||
$y = $height > 0 ? $lines-1 : 0;
|
||||
$line_step = $height > 0 ? -1 : 1;
|
||||
if ($bit_count == 1 || $bit_count == 4 || $bit_count == 8){
|
||||
$img = imagecreate($width, $lines);
|
||||
$palette_size = $header_size == 12 ? 3 : 4;
|
||||
$colors = $clr_used ? $clr_used : pow(2, $bit_count);
|
||||
$palette = array();
|
||||
for($i = 0; $i < $colors; ++$i){
|
||||
$buf = fread($stream, $palette_size);
|
||||
if ($buf === false){
|
||||
imagedestroy($img);
|
||||
return false;
|
||||
}
|
||||
extract(unpack("Cb/Cg/Cr/Cx", $buf . "\x00"));
|
||||
$palette[] = imagecolorallocate($img, $r, $g, $b);
|
||||
}
|
||||
|
||||
$shift_base = 8 - $bit_count;
|
||||
$mask = ((1 << $bit_count) - 1) << $shift_base;
|
||||
if ($compression == 1 || $compression == 2){
|
||||
$x = 0;
|
||||
$qrt_mod2 = $bit_count >> 2 & 1;
|
||||
for(;;){
|
||||
if ($x < -1 || $x > $width || $y < -1 || $y > $height){
|
||||
imagedestroy($img);
|
||||
return false;
|
||||
}
|
||||
$buf = fread($stream, 1);
|
||||
if ($buf === false){
|
||||
imagedestroy($img);
|
||||
return false;
|
||||
}
|
||||
switch($buf){
|
||||
case "\x00":
|
||||
$buf = fread($stream, 1);
|
||||
if ($buf === false){
|
||||
imagedestroy($img);
|
||||
return false;
|
||||
}
|
||||
switch($buf){
|
||||
case "\x00": //EOL
|
||||
$y += $line_step;
|
||||
$x = 0;
|
||||
break;
|
||||
case "\x01": //EOB
|
||||
$y = 0;
|
||||
$x = 0;
|
||||
break 3;
|
||||
case "\x02": //MOV
|
||||
$buf = fread($stream, 2);
|
||||
if ($buf === false){
|
||||
imagedestroy($img);
|
||||
return false;
|
||||
}
|
||||
list(,$xx, $yy) = unpack("C2", $buf);
|
||||
$x += $xx;
|
||||
$y += $yy * $line_step;
|
||||
break;
|
||||
default:
|
||||
list(,$pixels) = unpack("C", $buf);
|
||||
$bytes = ($pixels >> $qrt_mod2) + ($pixels & $qrt_mod2);
|
||||
$buf = fread($stream, ($bytes + 1) & ~1);
|
||||
if ($buf === false){
|
||||
imagedestroy($img);
|
||||
return false;
|
||||
}
|
||||
for ($i = 0, $pos = 0; $i < $pixels; ++$i, ++$x, $pos += $bit_count){
|
||||
list(,$c) = unpack("C", $buf[$pos >> 3]);
|
||||
$b = $pos & 0x07;
|
||||
imagesetpixel($img, $x, $y, $palette[($c & ($mask >> $b)) >> ($shift_base - $b)]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$buf2 = fread($stream, 1);
|
||||
if ($buf2 === false){
|
||||
imagedestroy($img);
|
||||
return false;
|
||||
}
|
||||
list(,$size, $c) = unpack("C2", $buf . $buf2);
|
||||
for($i = 0, $pos = 0; $i < $size; ++$i, ++$x, $pos += $bit_count){
|
||||
$b = $pos & 0x07;
|
||||
imagesetpixel($img, $x, $y, $palette[($c & ($mask >> $b)) >> ($shift_base - $b)]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for ($line = 0; $line < $lines; ++$line, $y += $line_step){
|
||||
$buf = fread($stream, $line_bytes);
|
||||
if ($buf === false){
|
||||
imagedestroy($img);
|
||||
return false;
|
||||
}
|
||||
|
||||
$pos = 0;
|
||||
for ($x = 0; $x < $width; ++$x, $pos += $bit_count){
|
||||
list(,$c) = unpack("C", $buf[$pos >> 3]);
|
||||
$b = $pos & 0x7;
|
||||
imagesetpixel($img, $x, $y, $palette[($c & ($mask >> $b)) >> ($shift_base - $b)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$img = imagecreatetruecolor($width, $lines);
|
||||
imagealphablending($img, false);
|
||||
if ($alpha_mask){
|
||||
imagesavealpha($img, true);
|
||||
}
|
||||
|
||||
//x軸進行量
|
||||
$pixel_step = $bit_count >> 3;
|
||||
$alpha_max = $alpha_mask ? 0x7f : 0x00;
|
||||
$alpha_mask_r = $alpha_mask ? 1/$alpha_mask : 1;
|
||||
$red_mask_r = $red_mask ? 1/$red_mask : 1;
|
||||
$green_mask_r = $green_mask ? 1/$green_mask : 1;
|
||||
$blue_mask_r = $blue_mask ? 1/$blue_mask : 1;
|
||||
|
||||
for ($line = 0; $line < $lines; ++$line, $y += $line_step){
|
||||
$buf = fread($stream, $line_bytes);
|
||||
if ($buf === false){
|
||||
imagedestroy($img);
|
||||
return false;
|
||||
}
|
||||
$pos = 0;
|
||||
for ($x = 0; $x < $width; ++$x, $pos += $pixel_step){
|
||||
list(,$c) = unpack("V", substr($buf, $pos, $pixel_step). "\x00\x00");
|
||||
$a_masked = $c & $alpha_mask;
|
||||
$r_masked = $c & $red_mask;
|
||||
$g_masked = $c & $green_mask;
|
||||
$b_masked = $c & $blue_mask;
|
||||
$a = $alpha_max - ((($a_masked<<7) - $a_masked) * $alpha_mask_r);
|
||||
$r = (($r_masked<<8) - $r_masked) * $red_mask_r;
|
||||
$g = (($g_masked<<8) - $g_masked) * $green_mask_r;
|
||||
$b = (($b_masked<<8) - $b_masked) * $blue_mask_r;
|
||||
imagesetpixel($img, $x, $y, ($a<<24)|($r<<16)|($g<<8)|$b);
|
||||
}
|
||||
}
|
||||
imagealphablending($img, true);
|
||||
}
|
||||
return $img;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
class ConfigModel extends Model{
|
||||
}
|
||||
|
@ -0,0 +1,224 @@
|
||||
<?php
|
||||
class MyCaptcha{
|
||||
var $keystring;
|
||||
function __construct($length){
|
||||
$alphabet = "0123456789abcdefghijklmnopqrstuvwxyz"; # do not change without changing font files!
|
||||
$width = 140;
|
||||
$height = 60;
|
||||
$fluctuation_amplitude = $height/10;//上下起伏
|
||||
$white_noise_density=1/10;//$white_noise_density=0; // no white noise
|
||||
$black_noise_density=1/100;//$black_noise_density=0; // no black noise
|
||||
$foreground_color = array(mt_rand(0,120), mt_rand(0,120), mt_rand(0,120));
|
||||
$background_color = array(mt_rand(220,255), mt_rand(220,255), mt_rand(220,255));
|
||||
|
||||
$font_path = dirname(__FILE__).'/MyCaptcha_fonts/';
|
||||
$fonts=array($font_path.'font_1.png',$font_path.'font_2.png',$font_path.'font_3.png');
|
||||
$alphabet_length=strlen($alphabet);
|
||||
do{
|
||||
$this->keystring = $this->randString($length);
|
||||
$font_file=$fonts[mt_rand(0, count($fonts)-1)];
|
||||
$font=imagecreatefrompng($font_file);
|
||||
imagealphablending($font, true);
|
||||
$fontfile_width=imagesx($font);
|
||||
$fontfile_height=imagesy($font)-1;
|
||||
|
||||
$font_metrics=array();
|
||||
$symbol=0;
|
||||
$reading_symbol=false;
|
||||
|
||||
// loading font
|
||||
for($i=0;$i<$fontfile_width && $symbol<$alphabet_length;$i++){
|
||||
$transparent = (imagecolorat($font, $i, 0) >> 24) == 127;
|
||||
if(!$reading_symbol && !$transparent){
|
||||
$font_metrics[$alphabet{$symbol}]=array('start'=>$i);
|
||||
$reading_symbol=true;
|
||||
continue;
|
||||
}
|
||||
if($reading_symbol && $transparent){
|
||||
$font_metrics[$alphabet{$symbol}]['end']=$i;
|
||||
$reading_symbol=false;
|
||||
$symbol++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$img=imagecreatetruecolor($width, $height);
|
||||
imagealphablending($img, true);
|
||||
$white=imagecolorallocate($img, 255, 255, 255);
|
||||
$black=imagecolorallocate($img, 0, 0, 0);
|
||||
imagefilledrectangle($img, 0, 0, $width-1, $height-1, $white);
|
||||
$x=1;
|
||||
$odd=mt_rand(0,1);
|
||||
if($odd==0) $odd=-1;
|
||||
for($i=0;$i<$length;$i++){
|
||||
$m=$font_metrics[$this->keystring{$i}];
|
||||
|
||||
$y=(($i%2)*$fluctuation_amplitude - $fluctuation_amplitude/2)*$odd
|
||||
+ mt_rand(-round($fluctuation_amplitude/3), round($fluctuation_amplitude/3))
|
||||
+ ($height-$fontfile_height)/2;
|
||||
$shift=1;
|
||||
imagecopy($img, $font, $x-$shift, $y, $m['start'], 1, $m['end']-$m['start'], $fontfile_height);
|
||||
$x+=$m['end']-$m['start']-$shift;
|
||||
}
|
||||
}while($x>=$width-10); // while not fit in canvas
|
||||
|
||||
//noise
|
||||
$white=imagecolorallocate($font, 255, 255, 255);
|
||||
$black=imagecolorallocate($font, 0, 0, 0);
|
||||
for($i=0;$i<(($height-30)*$x)*$white_noise_density;$i++){
|
||||
imagesetpixel($img, mt_rand(0, $x-1), mt_rand(10, $height-15), $white);
|
||||
}
|
||||
for($i=0;$i<(($height-30)*$x)*$black_noise_density;$i++){
|
||||
imagesetpixel($img, mt_rand(0, $x-1), mt_rand(10, $height-15), $black);
|
||||
}
|
||||
|
||||
$center=$x/2;
|
||||
// credits. To remove, see configuration file
|
||||
$img2=imagecreatetruecolor($width, $height);
|
||||
$foreground=imagecolorallocate($img2, $foreground_color[0], $foreground_color[1], $foreground_color[2]);
|
||||
$background=imagecolorallocate($img2, $background_color[0], $background_color[1], $background_color[2]);
|
||||
imagefilledrectangle($img2, 0, 0, $width-1, $height-1, $background);
|
||||
imagefilledrectangle($img2, 0, $height, $width-1, $height+12, $foreground);
|
||||
$this->drawLine($img2,$width,$height);
|
||||
|
||||
// periods
|
||||
$rand1=mt_rand(750000,1200000)/10000000;
|
||||
$rand2=mt_rand(750000,1200000)/10000000;
|
||||
$rand3=mt_rand(750000,1200000)/10000000;
|
||||
$rand4=mt_rand(750000,1200000)/10000000;
|
||||
// phases
|
||||
$rand5=mt_rand(0,31415926)/10000000;
|
||||
$rand6=mt_rand(0,31415926)/10000000;
|
||||
$rand7=mt_rand(0,31415926)/10000000;
|
||||
$rand8=mt_rand(0,31415926)/10000000;
|
||||
// amplitudes
|
||||
$rand9=mt_rand(330,420)/110;
|
||||
$rand10=mt_rand(330,450)/100;
|
||||
|
||||
//wave distortion
|
||||
for($x=0;$x<$width;$x++){
|
||||
for($y=0;$y<$height;$y++){
|
||||
$sx=$x+(sin($x*$rand1+$rand5)+sin($y*$rand3+$rand6))*$rand9-$width/2+$center+1;
|
||||
$sy=$y+(sin($x*$rand2+$rand7)+sin($y*$rand4+$rand8))*$rand10;
|
||||
|
||||
if($sx<0 || $sy<0 || $sx>=$width-1 || $sy>=$height-1){
|
||||
continue;
|
||||
}else{
|
||||
$color=imagecolorat($img, $sx, $sy) & 0xFF;
|
||||
$color_x=imagecolorat($img, $sx+1, $sy) & 0xFF;
|
||||
$color_y=imagecolorat($img, $sx, $sy+1) & 0xFF;
|
||||
$color_xy=imagecolorat($img, $sx+1, $sy+1) & 0xFF;
|
||||
}
|
||||
if($color==255 && $color_x==255 && $color_y==255 && $color_xy==255){
|
||||
continue;
|
||||
}else if($color==0 && $color_x==0 && $color_y==0 && $color_xy==0){
|
||||
$newred=$foreground_color[0];
|
||||
$newgreen=$foreground_color[1];
|
||||
$newblue=$foreground_color[2];
|
||||
}else{
|
||||
$frsx=$sx-floor($sx);
|
||||
$frsy=$sy-floor($sy);
|
||||
$frsx1=1-$frsx;
|
||||
$frsy1=1-$frsy;
|
||||
|
||||
$newcolor=(
|
||||
$color*$frsx1*$frsy1+
|
||||
$color_x*$frsx*$frsy1+
|
||||
$color_y*$frsx1*$frsy+
|
||||
$color_xy*$frsx*$frsy
|
||||
);
|
||||
if($newcolor>255) $newcolor=255;
|
||||
$newcolor=$newcolor/255;
|
||||
$newcolor0=1-$newcolor;
|
||||
|
||||
$newred=$newcolor0*$foreground_color[0]+$newcolor*$background_color[0];
|
||||
$newgreen=$newcolor0*$foreground_color[1]+$newcolor*$background_color[1];
|
||||
$newblue=$newcolor0*$foreground_color[2]+$newcolor*$background_color[2];
|
||||
}
|
||||
imagesetpixel($img2, $x, $y, imagecolorallocate($img2, $newred, $newgreen, $newblue));
|
||||
}
|
||||
}
|
||||
$this->showImage($img2);
|
||||
}
|
||||
public function getString(){
|
||||
return $this->keystring;
|
||||
}
|
||||
private function randString($length){
|
||||
$str = '';
|
||||
$allowed_symbols = "23456789abcdegikpqsvxyz"; //without symbols (o=0, 1=l, i=j, t=f)
|
||||
while(true){
|
||||
$str = '';
|
||||
for($i=0;$i<$length;$i++){
|
||||
$str .= $allowed_symbols{mt_rand(0,strlen($allowed_symbols)-1)};
|
||||
}
|
||||
if(!preg_match('/cp|cb|ck|c6|c9|rn|rm|mm|co|do|cl|db|qp|qb|dp|ww/',$str)) break;
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
private function frand(){
|
||||
return mt_rand(0,9999)/10000;
|
||||
}
|
||||
private function drawLine(&$img,$width,$height){
|
||||
$line_number = 5;
|
||||
$color_from = 100;
|
||||
for ($line = 0; $line < $line_number; ++ $line) {
|
||||
$line_color = imagecolorallocate($img, mt_rand($color_from,255),
|
||||
mt_rand($color_from, 255),mt_rand($color_from, 255));
|
||||
$x = $width * (1 + $line) / ($line_number + 1);
|
||||
$x += (0.5 - $this->frand()) * $width / $line_number;
|
||||
$y = mt_rand($height * 0.1, $height * 0.9);
|
||||
|
||||
$theta = ($this->frand() - 0.5) * M_PI * 0.7;
|
||||
$w = $width;
|
||||
$len = mt_rand($w * 0.4, $w * 0.7);
|
||||
$lwid = mt_rand(0, 2);
|
||||
|
||||
$k = $this->frand() * 0.6 + 0.2;
|
||||
$k = $k * $k * 0.5;
|
||||
$phi = $this->frand() * 6.28;
|
||||
$step = 0.5;
|
||||
$dx = $step * cos($theta);
|
||||
$dy = $step * sin($theta);
|
||||
$n = $len / $step;
|
||||
$amp = 1.5 * $this->frand() / ($k + 5.0 / $len);
|
||||
$x0 = $x - 0.5 * $len * cos($theta);
|
||||
$y0 = $y - 0.5 * $len * sin($theta);
|
||||
|
||||
$ldx = round(- $dy * $lwid);
|
||||
$ldy = round($dx * $lwid);
|
||||
for ($i = 0; $i < $n; ++ $i) {
|
||||
$x = $x0 + $i * $dx + $amp * $dy * sin($k * $i * $step + $phi);
|
||||
$y = $y0 + $i * $dy - $amp * $dx * sin($k * $i * $step + $phi);
|
||||
imagefilledrectangle($img, $x, $y, $x + $lwid, $y + $lwid,$line_color);
|
||||
}
|
||||
}
|
||||
|
||||
$allowed_symbols = "0123456789abcdefghijklmnopqrstuvwxyz";
|
||||
for ($i = 0; $i < 20; $i++) {//写入随机字串
|
||||
$char = $allowed_symbols[mt_rand(0,strlen($allowed_symbols)-1)];
|
||||
$line_color = imagecolorallocate($img,
|
||||
mt_rand($color_from,255),mt_rand($color_from, 255),mt_rand($color_from, 255));
|
||||
imagechar($img,mt_rand(0,4),mt_rand(0,$width),rand(0,$height),$char,$line_color);
|
||||
}
|
||||
}
|
||||
private function showImage(&$img){
|
||||
ob_get_clean();
|
||||
$out = ob_get_clean();//清除之前所有输出缓冲 TODO
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', FALSE);
|
||||
header('Pragma: no-cache');
|
||||
if(function_exists("imagejpeg")){
|
||||
header("Content-Type: image/jpeg");
|
||||
imagejpeg($img, null,90);//图片质量
|
||||
}else if(function_exists("imagegif")){
|
||||
header("Content-Type: image/gif");
|
||||
imagegif($img);
|
||||
}else if(function_exists("imagepng")){
|
||||
header("Content-Type: image/x-png");
|
||||
imagepng($img);
|
||||
}
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 14 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,91 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta http-equiv="Content-Script-Type" content="text/javascript">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||
<meta name="renderer" content="webkit">
|
||||
<link href="<?php echo STATIC_PATH;?>images/common/favicon.ico" rel="Shortcut Icon">
|
||||
<link href="<?php echo STATIC_PATH;?>style/common.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet"/>
|
||||
<link href="./static/style/font-awesome/css/font-awesome.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet">
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/base/app_explorer.css?ver=<?php echo KOD_VERSION;?>"/>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/win10.css?ver=<?php echo KOD_VERSION;?>"/>
|
||||
<title>File View</title>
|
||||
<!--[if IE 7]>
|
||||
<link rel="stylesheet" href="./static/style/font-awesome/css/font-awesome-ie7.css">
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
body{background: transparent;}
|
||||
.frame-main {top: 0;bottom: 0;}
|
||||
.show-code{width: 100%;left: 0;margin: 0;border: none;padding: 0;}
|
||||
.content-box{position: absolute;bottom: 0;top: 0;width: 100%;}
|
||||
.content-box iframe{width: 100%;height: 100%;}
|
||||
.content-box.markdown-preview {padding: 0;height: 100%;}
|
||||
.show-code,.show-code .ace_editor{height: 100%;}
|
||||
|
||||
.eidior-box{width:100%;height:100%;overflow: hidden;position: relative;}
|
||||
.eidior-content{position: absolute;top: 0;left: 0;bottom: 0;right: 0;}
|
||||
.eidior-content .ace_editor{height:100%;}
|
||||
.content-markdown {overflow: auto;height: 100%;padding: 0 20px;}
|
||||
|
||||
.context-menu-list.menu-zip-list-folder{display:none !important;}
|
||||
.menu-zip-list-file .context-menu-item.unzip-to,
|
||||
.menu-zip-list-file .context-menu-item.unzip-this,
|
||||
.menu-zip-list-file .context-menu-item.info,
|
||||
.menu-zip-list-file .context-menu-item.open-with,
|
||||
.menu-zip-list-file .context-menu-item.context-menu-separator{display:none !important;}
|
||||
|
||||
.ztree li a,.ztree li a:hover,
|
||||
.ztree li a.curSelectedNode, .ztree li span.name,
|
||||
.ztree li a.curDropTreeNode{height:30px;line-height:30px;}
|
||||
.ztree li span.tree_icon {height: 28px;width: 26px;}
|
||||
.ztree li span.tree_icon .x-item-file{width: 24px;height: 24px;}
|
||||
.zip-view-dialog .zip-view-content .ztree li a .menu-item-parent{width:30px;height:30px;line-height: 30px;}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div class="full-background"></div>
|
||||
<div class="init-loading"><div><img src="<?php echo STATIC_PATH;?>images/common/loading_simple.gif?v=<?php echo KOD_VERSION;?>"/></div></div>
|
||||
<div class="frame-main">
|
||||
<div class="bindary-box hidden">
|
||||
<div class="title"><div class="ico"></div></div>
|
||||
<div class="content-info">
|
||||
<div class="name"></div>
|
||||
<div class="size"><span></span><i class="share-time"></i></div>
|
||||
<div class="btn-group">
|
||||
<a type="button" class="btn btn-primary btn-download" href=""><?php echo LNG('download');?></a>
|
||||
</div>
|
||||
<div class="error-tips"><?php echo LNG('share_error_show_tips');?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-box"></div>
|
||||
</div><!-- / frame-main end-->
|
||||
<script type="text/javascript" src="<?php echo STATIC_PATH;?>js/lib/seajs/sea.js?ver=<?php echo KOD_VERSION;?>"></script>
|
||||
<script type="text/javascript" src="./index.php?share/commonJs&st=api&act=view#id=<?php echo rand_string(4);?>"></script>
|
||||
|
||||
<?php
|
||||
$path = rawurldecode($_GET['path']);
|
||||
$name = get_path_this($path);
|
||||
if(isset($_GET['name'])){$name = rawurldecode($_GET['name']);}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
G.shareInfo = {
|
||||
path:"<?php echo clear_html($path);?>",
|
||||
name:"<?php echo clear_html($name);?>",
|
||||
mtime:0,size:0
|
||||
}
|
||||
<?php if(ST.'.'.ACT == 'explorer.fileView'){echo "G.shareInfo.view = true;G.sharePage=undefined;";}?>
|
||||
G['accessToken'] = "<?php echo access_token_get();?>";
|
||||
seajs.config({
|
||||
base: "<?php echo STATIC_PATH;?>js/",
|
||||
preload: ["lib/jquery-1.8.0.min",'lib/ace/src-min-noconflict/ace'],
|
||||
map:[[/^(.*\.(?:css|js|html|htm|json|text))([\?|#].*)$/i,'$1$2?ver='+G.version]]
|
||||
});
|
||||
seajs.use("<?php echo STATIC_JS;?>/src/api/view/main");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,33 @@
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title><?php echo strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/base/app_setting.css?ver=<?php echo KOD_VERSION;?>"/>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/<?php echo $config['user']['theme'];?>.css?ver=<?php echo KOD_VERSION;?>" id='link-theme-style'/>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="body">
|
||||
<div class="app-menu-left menu-left">
|
||||
<h1><?php echo LNG('app');?></h1>
|
||||
<ul class='setting'>
|
||||
<a data-type="all"><i class="font-icon icon-reorder"></i><?php echo LNG('app_group_all');?></a>
|
||||
<?php foreach($config['settings']['appType'] as $item){?>
|
||||
<a data-type="<?php echo $item['type'];?>">
|
||||
<i class="font-icon <?php echo $item['class']?>"></i><?php echo LNG($item['name']);?></a>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class='app-content main'>
|
||||
<div class="app-model">
|
||||
<?php if($GLOBALS['isRoot']){ ?><button class="btn btn-default create-app" action='createApp'><?php echo LNG('app_create');?></button><?php } ?>
|
||||
<div class='h1'><i class="font-icon icon-user"></i><?php echo LNG('app_group_all');?></div>
|
||||
<ul class="app-list"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include(TEMPLATE.'common/footerCommon.html');?>
|
||||
<script type="text/javascript">
|
||||
seajs.use('app/src/app/main');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,26 @@
|
||||
<div class="common-footer aero">
|
||||
<?php
|
||||
$settings = $GLOBALS['config']['settings'];
|
||||
$settingSystem = $GLOBALS['config']['settingSystem'];
|
||||
$copyrightInfo = LNG('copyright_info',APP_HOST);
|
||||
if(is_wap()){
|
||||
echo '<span class="pr-10"><a href="javascript:void(0);" forceWap="1">'.LNG('wap_page_phone').'</a> | '.
|
||||
'<a href="javascript:void(0);" forceWap="0">'.LNG('wap_page_pc').'</a></span> ';
|
||||
echo $copyrightInfo.' v'.KOD_VERSION;
|
||||
}else{
|
||||
echo '<span class="copyright-content">';
|
||||
if(isset($settings['copyright'])){
|
||||
echo $settings['copyright'];
|
||||
}else{
|
||||
echo LNG('copyright_pre').' v'.KOD_VERSION.' | '.$copyrightInfo;
|
||||
}
|
||||
echo '<a href="javascript:core.copyright();" class="icon-info-sign copyright-bottom pl-5"></a>';
|
||||
if(isset($settingSystem['globalIcp'])){
|
||||
echo " ".$settingSystem['globalIcp'];
|
||||
}
|
||||
echo '</span>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<!-- https://getfirebug.com/firebuglite -->
|
||||
<?php include(TEMPLATE.'common/footerCommon.html');?>
|
@ -0,0 +1,44 @@
|
||||
<script type="text/javascript" src="<?php echo STATIC_PATH;?>js/lib/seajs/sea.js?ver=<?php echo KOD_VERSION;?>"></script>
|
||||
<?php
|
||||
//commonjs
|
||||
if(ST == 'share' || isset($GLOBALS['loadCommonJs'])){
|
||||
if(isset($_GET['user'])){
|
||||
$userInfo = '&user='.clear_html($_GET['user']).'&sid='.clear_html($_GET['sid']);
|
||||
}else{//login...
|
||||
$userInfo = "";
|
||||
}
|
||||
echo '<script type="text/javascript" src="./index.php?share/commonJs&st='.ST.'&act='.ACT.$userInfo.'#id='.rand_string(4).'"></script>';
|
||||
}else{
|
||||
echo '<script type="text/javascript" src="./index.php?user/commonJs&st='.ST.'&act='.ACT.'#id='.rand_string(4).'"></script>';
|
||||
}
|
||||
|
||||
$settings = $GLOBALS['config']['settings'];
|
||||
$settingSystem = $GLOBALS['config']['settingSystem'];
|
||||
if(isset($settings['globalJs'])){
|
||||
echo "\n ".'<script type="text/javascript" id="settings-global-js">'.$settings['globalJs'].'</script>';
|
||||
}
|
||||
if(isset($settings['globalCss'])){
|
||||
echo "\n ".'<style type="text/css" id="settings-global-css">'.$settings['globalCss'].'</style>';
|
||||
}
|
||||
if(isset($settingSystem['globalCss'])){
|
||||
echo "\n ".'<style type="text/css" id="setting-system-global-css">'.$settingSystem['globalCss'].'</style>';
|
||||
}
|
||||
if(isset($settingSystem['globalHtml'])){
|
||||
echo "\n ".$settingSystem['globalHtml']."\n";
|
||||
}
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
<?php
|
||||
if(defined('INSTALL_CHANNEL')){
|
||||
echo "var installChannel='".INSTALL_CHANNEL."';\n";
|
||||
}
|
||||
?>
|
||||
seajs.config({
|
||||
base: "<?php echo STATIC_PATH;?>js/",
|
||||
preload: ["lib/jquery-1.8.0.min"],
|
||||
map:[[/^(.*\.(?:css|js|html|htm|json|text))([\?|#].*)$/i,'$1$2?ver='+G.version]]
|
||||
});
|
||||
if(navigator.serviceWorker){navigator.serviceWorker.register('./?share/manifestJS');}
|
||||
</script>
|
||||
<?php Hook::trigger('templateCommonFooter');?>
|
@ -0,0 +1,39 @@
|
||||
<?php Hook::trigger('templateCommonHeaderStart'); ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta http-equiv="Content-Script-Type" content="text/javascript">
|
||||
<meta http-equiv="Cache-Control" content="no-transform">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="description" itemprop="description" content="<?php echo LNG('kod_meta_description');?>">
|
||||
<meta name="keywords" content="<?php echo LNG('kod_meta_keywords');?>" />
|
||||
<meta name="generator" content="<?php echo LNG('kod_meta_name').' '.KOD_VERSION;?>"/>
|
||||
<meta name="author" content="<?php echo LNG('kod_meta_name');?>" />
|
||||
<meta name="copyright" content="<?php echo LNG('kod_meta_copyright');?>" />
|
||||
<meta itemprop="image" content="<?php echo STATIC_PATH;?>images/common/ico.png?ver=<?php echo KOD_VERSION;?>" />
|
||||
<link href="<?php echo STATIC_PATH;?>images/common/ico.png?ver=<?php echo KOD_VERSION;?>" rel="Shortcut Icon" type="image/x-icon">
|
||||
<link href="<?php echo STATIC_PATH;?>images/common/ico.png?ver=<?php echo KOD_VERSION;?>" rel="icon" type="image/x-icon">
|
||||
<link href="<?php echo STATIC_PATH;?>style/common.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet"/>
|
||||
<link href="./static/style/font-awesome/css/font-awesome.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet">
|
||||
<link href="./?share/manifest" rel="manifest" />
|
||||
<!--[if IE 7]>
|
||||
<link rel="stylesheet" href="./static/style/font-awesome/css/font-awesome-ie7.css">
|
||||
<![endif]-->
|
||||
<?php
|
||||
Hook::trigger('templateCommonHeader');
|
||||
function pageBackground(){
|
||||
$arr = explode(',',$GLOBALS['config']['settingSystem']['wallpageLogin']);
|
||||
$background = $arr[mt_rand(0,count($arr)-1)];
|
||||
if(!$background){
|
||||
$background = 'linear-gradient(160deg, #5648c1, #6fe3e7)';
|
||||
}else if(!strstr($background,'/')){
|
||||
$background = "url('./static/images/wall_page/{$background}.jpg')";
|
||||
}else{
|
||||
$background = "url('{$background}')";
|
||||
}
|
||||
return "<style type='text/css'>.aero:before,.aero:after,.background{background-color:#bbb;background-image:{$background};}</style>\n";
|
||||
}
|
||||
?>
|
@ -0,0 +1,118 @@
|
||||
<div class="full-background"></div>
|
||||
<div class="init-loading">
|
||||
<div><img src="<?php echo STATIC_PATH;?>images/common/loading_simple.gif?v=<?php echo KOD_VERSION;?>"/></div>
|
||||
</div>
|
||||
<div class="topbar aero">
|
||||
<div class="content">
|
||||
<button class="btn btn-wap-menu hidden"
|
||||
data-toggle="collapse" data-target="#top-menu-left"
|
||||
><i class="font-icon icon-reorder"></i></button>
|
||||
|
||||
<div class="top-left collapse" id="top-menu-left">
|
||||
<?php
|
||||
$config = $GLOBALS['config'];
|
||||
$html = '<a href="./" class="topbar-menu title">';
|
||||
$subMenu = '';
|
||||
$isWap = is_wap();
|
||||
if(substr(LNG('kod_name'),0,4) == '<img'){
|
||||
$html .= LNG('kod_name').'</a>';
|
||||
}else{
|
||||
$html .= '<i class="icon-cloud"></i>'.LNG('kod_name').'</a>';
|
||||
}
|
||||
foreach ($config['settingSystem']['menu'] as $key=>$value) {
|
||||
if ($value['use']!='1') continue;
|
||||
$has = ST==$value['name']?'this':'';
|
||||
$target = " target='_self'" ;
|
||||
if($value['target']=='1' || $value['target'] == '_blank'){
|
||||
$target = " target='_blank'" ;
|
||||
}
|
||||
$name = rawurldecode($value['name']);
|
||||
if(LNG('ui_'.$name) != 'ui_'.$name){
|
||||
$name = "<i class='font-icon menu-".$name."'></i><span>".LNG('ui_'.$name).'</span>';
|
||||
}else if($value['icon']){
|
||||
$name = $value['icon'].'<span>'.LNG($name).'</span>';
|
||||
}else if(!strstr($name,'<') && $value['subMenu']){
|
||||
$name = "<i class='font-icon words'><em>".$name."</em></i><span>".LNG($name).'</span>';
|
||||
}
|
||||
if($value['subMenu'] && !$isWap){
|
||||
$subMenu .= "<li><a class='topbar-menu-sub ".$has."' href='".urldecode($value['url'])."'"
|
||||
.$target.">".urldecode($name)."</a></li>";
|
||||
}else{
|
||||
$html .= "<a class='topbar-menu ".$has."' href='".urldecode($value['url'])."'"
|
||||
.$target.">".urldecode($name)."</a>";
|
||||
}
|
||||
}
|
||||
echo $html;
|
||||
?>
|
||||
|
||||
<?php if($subMenu){?>
|
||||
<div class="menu-group fl">
|
||||
<a class="topbar-menu" id="topbar-submenu"
|
||||
data-toggle="dropdown" href="#" title="<?php echo LNG('menu_sub_menu');?>">
|
||||
<i class="icon-th-large"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu topbar-submenu pull-left animated menuShow" role="menu" aria-labelledby="topbar-submenu">
|
||||
<?php echo $subMenu;?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="top-right">
|
||||
<?php if(!isset($config['settings']['language'])){ ?>
|
||||
<div class="menu-group">
|
||||
<a id='topbar-language' data-toggle="dropdown" href="#" class="topbar-menu">
|
||||
<i class='font-icon icon-flag'></i> <b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu topbar-language pull-right animated menuShow" role="menu" aria-labelledby="topbar-language">
|
||||
<?php
|
||||
$tpl = "";
|
||||
foreach ($config['settingAll']['language'] as $key => $value) {
|
||||
$name = $value[0];
|
||||
$select = I18n::getType() == $key ? "this":"";
|
||||
$tpl .= "<li><a href='javascript:core.language(\"{$key}\");' title=\"{$key}/{$value[1]}/{$value[2]}\" class='{$select}'><i class='lang-flag flag-{$key}'></i>{$name}</a></li>";
|
||||
}
|
||||
echo $tpl;
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!-- 全局设置语言则不再显示 -->
|
||||
|
||||
<div class="menu-group">
|
||||
<a href="#" id='topbar-user' data-toggle="dropdown" class="topbar-menu">
|
||||
<i class="font-icon icon-user"></i>
|
||||
<?php
|
||||
$user = $_SESSION['kodUser'];
|
||||
$name = $user['nickName']?$user['nickName']:$user['name'];
|
||||
echo clear_html($name);
|
||||
?>
|
||||
<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu menu-topbar-user pull-right animated menuShow" role="menu" aria-labelledby="topbar-user">
|
||||
<?php if($GLOBALS['isRoot']){ ?>
|
||||
<li class="menu-system-setting"><a href="#" onclick="core.setting('system');"><i class="font-icon icon-cog"></i><?php echo LNG('system_setting');?></a></li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if($GLOBALS['isRoot'] || $GLOBALS['auth']['systemMember.get']){ ?>
|
||||
<li class="menu-system-group"><a href="#" onclick="core.setting('member');"><i class="font-icon icon-group"></i><?php echo LNG('setting_member');?></a></li>
|
||||
<?php } ?>
|
||||
<?php if($GLOBALS['isRoot'] || $GLOBALS['auth']['pluginApp.index']){ ?>
|
||||
<li class="menu-system-plugin">
|
||||
<a href="#" onclick="core.openWindowBig('./index.php?pluginApp/index','<?php echo LNG('PluginCenter');?>');"><i class="font-icon icon-puzzle-piece"></i><?php echo LNG('PluginCenter');?></a></li>
|
||||
<li role="presentation" class="divider"></li>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<li class="menu-system-user"><a href="#" onclick="core.setting('user');"><i class="font-icon icon-user"></i><?php echo LNG('setting_user');?></a></li>
|
||||
<li class="menu-system-theme"><a href="#" onclick="core.setting('theme');"><i class="font-icon icon-dashboard"></i><?php echo LNG('setting_theme');?></a></li>
|
||||
<li class="menu-system-full"><a href="#" onclick="core.fullScreen();"><i class="font-icon icon-fullscreen"></i><?php echo LNG('full_screen');?></a></li>
|
||||
<li class="menu-system-help"><a href="#" onclick="core.setting('help');"><i class="font-icon icon-question"></i><?php echo LNG('setting_help');?></a></li>
|
||||
<li class="menu-system-about"><a href="#" onclick="core.setting('about');"><i class="font-icon icon-info-sign"></i><?php echo LNG('setting_about');?></a></li>
|
||||
<li role="presentation" class="divider"></li>
|
||||
<li class="menu-system-logout"><a href="./index.php?user/logout"><i class="font-icon icon-signout"></i><?php echo LNG('ui_logout');?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,67 @@
|
||||
<div class="full-background"></div>
|
||||
<div class="init-loading"><div>
|
||||
<img src="<?php echo STATIC_PATH;?>images/common/loading_simple.gif?v=<?php echo KOD_VERSION;?>"/></div>
|
||||
</div>
|
||||
<div class="topbar share-page-topbar">
|
||||
<div class="content">
|
||||
<div class="top-left">
|
||||
<a href="./" class="topbar-menu title">
|
||||
<?php
|
||||
if(substr(LNG('kod_name'),0,4) == '<img'){
|
||||
echo LNG('kod_name');
|
||||
}else{
|
||||
echo '<i class="icon-cloud"></i>'.LNG('kod_name');
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
<div class="share-info">
|
||||
<span class="share-title">
|
||||
<b class="share-title-info">
|
||||
<?php clear_html($shareInfo['showName']);?>
|
||||
</b>
|
||||
</span>
|
||||
<span class="size"></span>
|
||||
<span class="time"></span>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
<div class="top-right">
|
||||
<div class="share-info-user hidden menu-group" style="z-index:9999;">
|
||||
<span class="info"></span>
|
||||
<div class="btn-group">
|
||||
<a type="button" class="btn btn-primary btn-download" target="_blank" href=""><?php echo LNG('download');?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if(!isset($config['settings']['language'])){ ?>
|
||||
<div class="menu-group">
|
||||
<a id='topbar-language' data-toggle="dropdown" href="#" class="topbar-menu">
|
||||
<i class='font-icon icon-flag'></i> <b class="caret"></b>
|
||||
</a>
|
||||
<a href="#" onclick="core.qrcode(window.location.href);" title="<?php echo LNG('qrcode');?>" class="topbar-menu" style="padding: 0 15px;margin-left: -2px;">
|
||||
<i class="font-icon icon-qrcode"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu topbar-language pull-right animated menuShow" role="menu" aria-labelledby="topbar-language">
|
||||
<?php
|
||||
$tpl = "";
|
||||
foreach ($config['settingAll']['language'] as $key => $value) {
|
||||
$name = $value[0];
|
||||
$select = I18n::getType() == $key ? "this":"";
|
||||
$tpl .= "<li><a href='javascript:core.language(\"{$key}\");' title=\"{$key}/{$value[1]}/{$value[2]}\" class='{$select}'><i class='lang-flag flag-{$key}'></i>{$name}</a></li>";
|
||||
}
|
||||
echo $tpl;
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="menu-group">
|
||||
<a href="#" id='topbar-user' class="topbar-menu" data-toggle="dropdown"><i class="font-icon icon-user"></i><?php echo $_SESSION['kodUser']['name'];?> <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu menu-topbar-user pull-right animated menuShow" role="menu" aria-labelledby="topbar-user">
|
||||
<li><a href="#" onclick="core.fullScreen();"><i class="font-icon icon-fullscreen"></i><?php echo LNG('full_screen');?></a></li>
|
||||
<li class="version_vip_free"><a href="http://kodcloud.com" target="_blank"><i class="font-icon icon-code-fork"></i><?php echo LNG('ui_project_home');?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,103 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<link href="<?php echo STATIC_PATH;?>style/common.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet"/>
|
||||
<link href="./static/style/font-awesome/css/font-awesome.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet">
|
||||
<title><?php echo $title;?></title>
|
||||
<script type="text/javascript" src="<?php echo STATIC_PATH;?>js/lib/jquery-1.8.0.min.js?ver=<?php echo KOD_VERSION;?>"></script>
|
||||
<style type="text/css">
|
||||
body{
|
||||
background-color:#f0f2f5;
|
||||
font-family: Verdana,"Lantinghei SC","Hiragino Sans GB","Microsoft Yahei",Helvetica,arial,sans-serif;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
body a,body a:hover{color: #1890ff;}
|
||||
.body-panel{
|
||||
width:70%;margin:10% auto 5% auto;
|
||||
font-size: 13px;
|
||||
color:#666;
|
||||
background:#fff;border-radius:4px;
|
||||
padding-top:50px;padding-bottom:100px;
|
||||
box-shadow: 0 5px 20px rgba(0,0,0,0.05);
|
||||
}
|
||||
.body-panel .check-result{text-align: center;color:#000;}
|
||||
.body-panel .check-result .icon{width:70px;height:70px;line-height:70px;font-size:30px;}
|
||||
.check-result-title{font-size: 24px;line-height: 32px;margin:20px 0;}
|
||||
.check-result-desc{
|
||||
color: #333;
|
||||
margin: 0 0 20px 0;
|
||||
background: #fafafa;
|
||||
font-size: 16px;
|
||||
width: 80%;
|
||||
margin: 0 auto;
|
||||
border-radius: 2px;
|
||||
padding: 24px 40px;
|
||||
text-align: left;
|
||||
}
|
||||
.error-info{
|
||||
border-left: 5px solid #1890ff;
|
||||
display: block;
|
||||
padding: 5px 10px;
|
||||
background: #fcfcfc;
|
||||
color: #666;
|
||||
word-break: break-all;
|
||||
font-family: monospace;
|
||||
}
|
||||
.location-to{padding: 10px 0;color: #888;font-size: 13px;font-style: italic;}
|
||||
.icon{
|
||||
font-family: FontAwesome;
|
||||
display: inline-block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: rgba(0, 0, 0, 0.02);
|
||||
text-align: center;
|
||||
color: #666;
|
||||
border-radius: 50%;
|
||||
line-height: 20px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.icon.icon-loading{
|
||||
-webkit-animation: moveCircleLoopRight 1.4s infinite linear;
|
||||
animation: moveCircleLoopRight 1.4s infinite linear;
|
||||
}
|
||||
.icon.icon-loading:before{content:"\f110";}
|
||||
.icon.icon-success{background:#52c41a;color:#fff;}
|
||||
.icon.icon-success:before{content:"\f00c";}
|
||||
.icon.icon-error{background:#f5222d;color:#fff;}
|
||||
.icon.icon-error:before{content:"\f00d";}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<div class="body-panel">
|
||||
<div class="check-result">
|
||||
<!-- <div class="icon icon-error"></div> -->
|
||||
<div class="check-result-title"><?php echo $title;?></div>
|
||||
<div class="check-result-desc">
|
||||
<span class="error-info"><?php echo $message;?></span>
|
||||
<div class="location-to"><?php echo $info;?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($url){ ?>
|
||||
<script>
|
||||
var timeout = parseInt("<?php echo $time;?>");
|
||||
var link = "<?php echo $url;?>";
|
||||
var loop = setInterval(function(){
|
||||
timeout --;
|
||||
var info = timeout + "s 后自动跳转, <a href='"+link+"'>立即跳转</a>";
|
||||
$('.location-to').html(info);
|
||||
if(timeout<=0){
|
||||
clearInterval(loop);
|
||||
window.location.href = link;
|
||||
}
|
||||
},1000);
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,55 @@
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title><?php echo LNG('ui_desktop').' - '.strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/base/app_desktop.css?ver=<?php echo KOD_VERSION;?>"/>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/<?php echo $config['user']['theme'];?>.css?ver=<?php echo KOD_VERSION;?>" id='link-theme-style'/>
|
||||
|
||||
</head>
|
||||
<body style="overflow: hidden;" oncontextmenu="return core.contextmenu();" id="page-desktop">
|
||||
<?php echo '<style >.aero:before,.aero:after,.full-background-wall{background-image:url('.$wall.')}</style>';?>
|
||||
<div class="full-background-wall desktop"><img class="background" /></div>
|
||||
|
||||
<?php include(TEMPLATE.'common/navbar.html');?>
|
||||
<div class='bodymain drag-upload-box desktop'>
|
||||
<div class="file-continer file-list-icon hidden"></div>
|
||||
</div><!-- html5拖拽上传list -->
|
||||
|
||||
<a href="#" class="start"></a>
|
||||
<div id="taskbar" style="display:block;" class="">
|
||||
<div class="taskbar-background aero"></div>
|
||||
<div id="desktop"></div>
|
||||
</div>
|
||||
<div class="taskbar-right">
|
||||
<div class="copyright dropdown-toggle"><i class="icon-info-sign"></i></div>
|
||||
<div class="tab-hide-all"></div>
|
||||
</div>
|
||||
<div id="menuwin" class="aero">
|
||||
<div id="startmenu"></div>
|
||||
<ul id="programs">
|
||||
<li class='setting_help'><a href="#" onclick="core.setting('help');"><?php echo LNG('setting_help');?></a></li>
|
||||
<li><div id="leftspliter"></div></li>
|
||||
<li class='setting_about'><a href="#" onclick="core.setting('about');"><?php echo LNG('setting_about');?></a></li>
|
||||
<li class='setting_user'><a href="#" onclick="core.setting('user');"><?php echo LNG('setting_user');?></a></li>
|
||||
<li class='setting_homepage'><a href="#" onclick="core.openWindow('http://kodcloud.com','<?php echo $L['my_document'];?>');">kodCloud 主页</a></li>
|
||||
</ul>
|
||||
<ul id="links">
|
||||
<li class="icon"></li>
|
||||
<li><a href="#" onclick="core.explorer('<?php echo KOD_USER_SHARE.':'.$_SESSION['kodUser']['userID'].'/';?>','<?php echo LNG('my_share');?>');"><span><?php echo LNG('my_share');?></span></a></li>
|
||||
<li><a href="#" onclick="core.explorer('<?php echo MYHOME;?>/pictures','<?php echo LNG('my_picture');?>');"><span><?php echo LNG('my_picture');?></span></a></li>
|
||||
<li><a href="#" onclick="core.explorer('<?php echo MYHOME;?>/music','<?php echo LNG('my_music');?>');"><span><?php echo LNG('my_music');?></span></a></li>
|
||||
<li><a href="#" onclick="core.explorer('<?php echo MYHOME;?>/download','<?php echo LNG('download');?>');"><span><?php echo LNG('download');?></span></a></li>
|
||||
<li><div id="rightspliter"></div></li>
|
||||
<li><a href="#" onclick="core.setting('wall');"><span><?php echo LNG('setting_wall');?></span></a></li>
|
||||
<li><a href="#" onclick="core.setting('fav');"><span><?php echo LNG('setting_fav');?></span></a></li>
|
||||
<li><a href="#" onclick="core.setting('theme');"><span><?php echo LNG('setting_theme');?></span></a></li>
|
||||
<li><a href="./index.php?user/logout" style="margin-top:70px;"><span><?php echo LNG('ui_logout');?>></span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php include(TEMPLATE.'common/footerCommon.html');?>
|
||||
<script type="text/javascript">
|
||||
var desktopApps = <?php echo json_encode($desktopApps);?>;
|
||||
G.thisPath = G.myDesktop;
|
||||
seajs.use("app/src/desktop/main");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,90 @@
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title><?php echo strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/base/app_code_edit.css?ver=<?php echo KOD_VERSION;?>"/>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/<?php echo $config['user']['theme'];?>.css?ver=<?php echo KOD_VERSION;?>" id='link-theme-style'/>
|
||||
|
||||
</head>
|
||||
<body <?php echo $codeThemeBlack;?>>
|
||||
<div class="init-loading">
|
||||
<div><img src="<?php echo STATIC_PATH;?>images/common/loading_simple.gif?v=<?php echo KOD_VERSION;?>"/></div>
|
||||
</div>
|
||||
<div class="edit-main" style="height: 100%;" oncontextmenu="return core.contextmenu();">
|
||||
<div class="tools">
|
||||
<div class="left top-toolbar">
|
||||
<div class="disable-mask"></div>
|
||||
<a action="save" href="javascript:;" title="<?php echo LNG('button_save');?>(Ctrl-S)"><i class="font-icon icon-save"></i></a>
|
||||
<a action="saveall" href="javascript:;" title="<?php echo LNG('button_save_all');?>"><i class="font-icon icon-paste"></i></a>
|
||||
<span class="line"></span>
|
||||
<a href="javascript:;" id="editor-history-back" title="<?php echo LNG('history_back');?>(Ctrl -)"><i class="font-icon icon-chevron-left"></i></a>
|
||||
<a href="javascript:;" id="editor-history-next" title="<?php echo LNG('history_next');?>(Ctrl Shift -)"><i class="font-icon icon-chevron-right"></i></a>
|
||||
<span class="line"></span>
|
||||
<a action="undo" href="javascript:;" title="<?php echo LNG('undo');?>(Ctrl-Z)"><i class="font-icon icon-undo"></i></a>
|
||||
<a action="redo" href="javascript:;" title="<?php echo LNG('redo');?>(Ctrl-Y)"><i class="font-icon icon-repeat"></i></a>
|
||||
<a action="refresh" href="javascript:;" title="<?php echo LNG('refresh');?>(F5)"><i class="font-icon icon-refresh"></i></a>
|
||||
<span class="line"></span>
|
||||
<a href="javascript:;" class="toolbar-menu menu-view-goto-line" title="<?php echo LNG('gotoline');?>(Ctrl-L)"><i class="font-icon icon-pushpin"></i></a>
|
||||
<a action="search" href="javascript:;" title="<?php echo LNG('search');?>(Ctrl-F)"><i class="font-icon icon-search"></i></a>
|
||||
<a action="searchReplace" href="javascript:;" title="<?php echo LNG('replace');?>(Ctrl-F-F)"><i class="font-icon icon-random"></i></a>
|
||||
<span class="line"></span>
|
||||
<a action="font" class="toolbar-menu menu-view-font" href="javascript:;" title="<?php echo LNG('font_size');?>">
|
||||
<i class="font-icon icon-font"></i><i class="font-icon icon-caret-down"></i>
|
||||
</a>
|
||||
<span class="line"></span>
|
||||
<a class="toolbar-menu menu-view-theme" href="javascript:;" title="<?php echo LNG('code_theme');?>">
|
||||
<i class="font-icon icon-magic"></i><i class="font-icon icon-caret-down"></i>
|
||||
</a>
|
||||
<a class="toolbar-menu menu-view-setting" href="javascript:;">
|
||||
<i class="font-icon icon-cog"></i><i class="font-icon icon-caret-down"></i>
|
||||
</a>
|
||||
<a action="preview" href="javascript:;" title="<?php echo LNG('preview');?>(Ctrl-Shift-S)"><i class="font-icon icon-eye-open"></i></a>
|
||||
</div>
|
||||
<div class="right">
|
||||
|
||||
<button class="btn btn-xs btn-default btn-right" action="close" title="<?php echo LNG('close');?>"><i class="font-icon icon-remove"></i></button>
|
||||
<button class="btn btn-xs btn-default btn-left" action="fullscreen" title="<?php echo LNG('full_screen');?>"><i class="font-icon icon-resize-full"></i></button>
|
||||
</div>
|
||||
<div style="clear:both"></div>
|
||||
</div><!-- end tools -->
|
||||
|
||||
<!-- 主体部分 -->
|
||||
<div class="frame-left">
|
||||
<div class="edit-tab">
|
||||
<div class="tabs">
|
||||
<a href="javascript:Editor.add()" class="add icon-plus"></a>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="edit-body">
|
||||
<div class="introduction hidden">
|
||||
<button class="btn btn-default font-icon icon-remove close-item"></button>
|
||||
<?php include(LANGUAGE_PATH.I18n::getType().'/edit.html');?>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
<div class="tabs"></div>
|
||||
<div class="bottom-toolbar hidden">
|
||||
<a class="toolbar-menu menu-view-goto-line editor_position" href="javascript:;">0:0</a>
|
||||
<a class="file-mode" href="javascript:;">text</a>
|
||||
<a class="toolbar-menu menu-view-file-charset " href="javascript:;">UTF-8</a>
|
||||
<a class="toolbar-menu menuViewTab config-tab" href="javascript:;">Tabs:4</a>
|
||||
<a class="toolbar-menu menu-view-setting config" href="javascript:;"><i class="font-icon icon-cog"></i></a>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-content hidden"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include(TEMPLATE.'common/footerCommon.html');?>
|
||||
<script type="text/javascript">
|
||||
G.codeConfig = <?php echo $editorConfig;?>;
|
||||
G.codeThemeAll = "<?php echo $config['settingAll']['codethemeall']?>";
|
||||
G.codeFontAll = "<?php echo $config['settingAll']['codefontall']?>";
|
||||
seajs.config({
|
||||
preload: [
|
||||
"lib/jquery-1.8.0.min",
|
||||
'lib/ace/src-min-noconflict/ace'
|
||||
]
|
||||
});
|
||||
seajs.use("app/src/edit/main");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,45 @@
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title><?php echo LNG('ui_editor').' - '.strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/base/app_editor.css?ver=<?php echo KOD_VERSION;?>"/>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/<?php echo $config['user']['theme'];?>.css?ver=<?php echo KOD_VERSION;?>" id='link-theme-style'/>
|
||||
|
||||
</head>
|
||||
|
||||
<?php if(isset($_GET['project'])){?>
|
||||
<style>.topbar{display: none;}.frame-header{top:0;}.frame-main{top:0px;}</style>
|
||||
<?php } ?>
|
||||
|
||||
<body style="overflow:hidden;" oncontextmenu="return core.contextmenu();" id="page-editor">
|
||||
<?php include(TEMPLATE.'common/navbar.html');?>
|
||||
<div class="frame-main">
|
||||
<div class="tools-left">
|
||||
<a class="home" href="#" title='<?php echo LNG('root_path');?>'><i class="icon-home"></i></a>
|
||||
<a class="view" href="#" title='<?php echo LNG('manage_folder');?>'><i class="icon-laptop"></i></a>
|
||||
<a class="folder" href="#" title='<?php echo LNG('newfolder');?>'><i class="icon-folder-close-alt"></i></a>
|
||||
<a class="file" href="#" title='<?php echo LNG('newfile');?>'><i class="icon-file-alt"></i></a>
|
||||
<a class="refresh" href="#" title='<?php echo LNG('refresh');?>'><i class="icon-refresh"></i></a>
|
||||
</div>
|
||||
<div class='frame-left'>
|
||||
<ul id="folder-list-tree" class="ztree"></ul>
|
||||
</div><!-- / frame-left end-->
|
||||
<div class='frame-resize'></div>
|
||||
<div class='frame-right'>
|
||||
<div class="frame-right-main" style="height:100%;padding:0;margin:0;">
|
||||
<div class="resize-mask"></div>
|
||||
<div class="message-box"><div class="content"></div></div>
|
||||
<div class="menu-tree-root"></div>
|
||||
<div class="menu-tree-folder"></div>
|
||||
<div class="menu-tree-file"></div>
|
||||
<div class ='frame'>
|
||||
<iframe name="OpenopenEditor" src="./index.php?editor/edit" style="width:100%;height:100%;border:0;" frameborder=0></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- / frame-right end-->
|
||||
</div><!-- / frame-main end-->
|
||||
<?php include(TEMPLATE.'common/footerCommon.html');?>
|
||||
<script type="text/javascript">
|
||||
G.project = "<?php echo clear_html($_GET['project']) ;?>";
|
||||
seajs.use("app/src/editor/main");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,234 @@
|
||||
<div class="frame-main">
|
||||
<div class='frame-left'>
|
||||
<ul id="folder-list-tree" class="ztree"></ul>
|
||||
<div class="bottom-box">
|
||||
<div class="user-space-info"></div>
|
||||
<div class="box-content">
|
||||
<div class="cell menu-recycle-button"><i class="font-icon icon-trash"></i><span><?php echo LNG('recycle');?></span></div>
|
||||
<div class="cell menuShareButton"><i class="font-icon icon-share-sign"></i><span><?php echo LNG('my_share');?></span></div>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- / frame-left end-->
|
||||
|
||||
<div class='frame-resize'></div>
|
||||
<div class='frame-right'>
|
||||
<div class="frame-header">
|
||||
<div class="header-content">
|
||||
<div class="header-left">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-default" id='btn-history-back' title='<?php echo LNG('history_back');?>' type="button">
|
||||
<i class="font-icon icon-angle-left"></i>
|
||||
</button>
|
||||
<button class="btn btn-default" id='btn-history-next' title='<?php echo LNG('history_next');?>' type="button">
|
||||
<i class="font-icon icon-angle-right"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div><!-- /header left -->
|
||||
|
||||
<div class='header-middle'>
|
||||
<button class="btn btn-default btn-left-radius ml-10" id='home' title='<?php echo LNG('root_path');?>'>
|
||||
<i class="font-icon icon-home"></i>
|
||||
</button>
|
||||
<div id='yarnball' title="<?php echo LNG('address_in_edit');?>"></div>
|
||||
<div id='yarnball-input'><input type="text" name="path" value="" class="path" id="path"/></div>
|
||||
|
||||
<button class="btn btn-default" id='fav' title='<?php echo LNG('add_to_fav');?>' type="button">
|
||||
<i class="font-icon icon-star"></i>
|
||||
</button>
|
||||
<!-- <button class="btn btn-default" id='refresh' title='<?php echo LNG('refresh_all');?>' type="button">
|
||||
<i class="font-icon icon-refresh"></i>
|
||||
</button> -->
|
||||
<button class="btn btn-default btn-right-radius" id='goto-father' title='<?php echo LNG('go_up');?>' type="button">
|
||||
<i class="font-icon icon-circle-arrow-up"></i>
|
||||
</button>
|
||||
<div class="path-tips" title="<?php echo LNG('only_read_desc');?>" title-timeout="0">
|
||||
<i class="icon-warning-sign"></i><span></span>
|
||||
</div>
|
||||
|
||||
<div class="role-label-box"></div>
|
||||
</div><!-- /header-middle end-->
|
||||
<div class='header-right'>
|
||||
<input type="text" name="seach" class="btn-left-radius"/>
|
||||
<button class="btn btn-default btn-right-radius" id='search' title='<?php echo LNG('search');?>' type="button">
|
||||
<i class="font-icon icon-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- / header end -->
|
||||
<div class="frame-right-main">
|
||||
<div class="tools">
|
||||
<div class="tools-left tools-left-share <?php if(ST!='share'){echo 'hidden';}?>">
|
||||
<!-- 文件功能 -->
|
||||
<div class="kod-toolbar kod-toolbar-path btn-group btn-group-sm">
|
||||
<button data-action='select-all' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-check"></i><?php echo LNG('selectAll');?>
|
||||
</button>
|
||||
<button data-action='upload' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-cloud-upload"></i><?php echo LNG('upload');?>
|
||||
</button>
|
||||
|
||||
<button data-action='download' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-download"></i><?php echo LNG('download');?>
|
||||
</button>
|
||||
</div>
|
||||
<span class='msg'><?php echo LNG('path_loading');?></span>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tools-left tools-left-explorer <?php if(ST=='share'){echo 'hidden';}?>">
|
||||
<!-- 回收站tool -->
|
||||
<div class="kod-toolbar kod-toolbar-recycle btn-group btn-group-sm hidden fl-left">
|
||||
<button data-action='recycle-clear' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-folder-close-alt"></i><?php echo LNG('recycle_clear');?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- 分享 tool -->
|
||||
<div class="kod-toolbar kod-toolbar-share hidden fl-left">
|
||||
<button data-action='refresh' class="btn btn-sm btn-default fl-left" type="button">
|
||||
<i class="font-icon icon-refresh"></i><?php echo LNG('refresh');?>
|
||||
</button>
|
||||
<div class="select-button-show-share btn-group btn-group-sm fl-left ml-10 mr-10 hidden">
|
||||
<button data-action='remove' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-remove"></i><?php echo LNG('share_remove');?>
|
||||
</button>
|
||||
<button data-action='shareEdit' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-edit"></i><?php echo LNG('share_edit');?>
|
||||
</button>
|
||||
<button data-action='shareOpenWindow' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-link"></i><?php echo LNG('share_open_page');?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 文件功能 -->
|
||||
<div class="kod-toolbar kod-toolbar-path fl-left">
|
||||
<div class="select-button-default btn-group btn-group-sm fl-left mr-10">
|
||||
<button data-action='newfolder' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-folder-close-alt"></i><?php echo LNG('newfolder');?>
|
||||
</button>
|
||||
<button data-action='newfile' class="btn btn-default tool-path-newfile" type="button">
|
||||
<i class="font-icon icon-caret-down"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="select-button-default btn-group btn-group-sm fl-left mr-10">
|
||||
<button data-action='upload' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-cloud-upload"></i><?php echo LNG('upload');?>
|
||||
</button>
|
||||
<button data-action='upload-more' class="btn btn-default tool-path-upload" type="button">
|
||||
<i class="font-icon icon-caret-down"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="select-button-show btn-group btn-group-sm fl-left ml-10 mr-10 hidden">
|
||||
<button data-action='share' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-share"></i><?php echo LNG('share');?>
|
||||
</button>
|
||||
<button data-action='download' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-download"></i><?php echo LNG('download');?>
|
||||
</button>
|
||||
<button data-action='remove' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-remove"></i><?php echo LNG('remove');?>
|
||||
</button>
|
||||
<button data-action='rname' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-rename"></i><?php echo LNG('rename');?>
|
||||
</button>
|
||||
|
||||
<button data-action='copy' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-copy"></i><?php echo LNG('copy');?>
|
||||
</button>
|
||||
<button data-action='cute' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-cute"></i><?php echo LNG('cute');?>
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm toolbar-path-more fl-left mr-10">
|
||||
<i class="font-icon icon-ellipsis-horizontal"></i>
|
||||
<?php echo LNG('button_more');?> <span class="caret"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="group-space-use fl-left hidden"></div>
|
||||
<div class="admin-real-path hidden fl-left">
|
||||
<button type="button" class="btn btn-default btn-sm dialog-goto-path ml-10" title="<?php echo LNG('open_the_path');?>">
|
||||
<i class="font-icon icon-folder-open"></i>
|
||||
</button>
|
||||
</div>
|
||||
<span class='msg fl-left'><?php echo LNG('path_loading');?></span>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools-right">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button data-action='set-icon' title="<?php echo LNG('list_icon');?>" type="button" class="btn btn-default">
|
||||
<i class="font-icon icon-th"></i>
|
||||
</button>
|
||||
<button data-action='set-list' title="<?php echo LNG('list_list');?>" type="button" class="btn btn-default">
|
||||
<i class="font-icon icon-list"></i>
|
||||
</button>
|
||||
<button data-action='set-split' title="<?php echo LNG('list_list_split');?>" type="button" class="btn btn-default">
|
||||
<i class="font-icon icon-columns"></i>
|
||||
</button>
|
||||
|
||||
<div class="btn-group btn-group-sm menu-theme-list">
|
||||
<button data-action="set-theme" title="<?php echo LNG('setting_theme');?>" type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="font-icon icon-dashboard"></i> <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right dropdown-menu-theme animated menuShow">
|
||||
<?php
|
||||
$arr = explode(',',$config['settingAll']['themeall']);
|
||||
foreach ($arr as $value) {
|
||||
echo "<li class='list' theme='{$value}'><a href='javascript:void(0);'>".LNG('theme_'.$value)."</a></li>\n";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="set-icon-size">
|
||||
<span class="dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="font-icon icon-zoom-in"></i>
|
||||
</span>
|
||||
<ul class="dropdown-menu set-icon-size-slider animated menuShow">
|
||||
<div class="slider-bg"></div>
|
||||
<div class="slider-handle"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear:both"></div>
|
||||
</div><!-- end tools -->
|
||||
<div id='list-type-header' class="hidden">
|
||||
<div id="main-title">
|
||||
<div class="filename" field="name"><?php echo LNG('name');?><span></span></div><div class="resize filename-resize"></div>
|
||||
<div class="filetype" field="ext"><?php echo LNG('type');?><span></span></div><div class="resize filetype-resize"></div>
|
||||
<div class="filesize" field="size"><?php echo LNG('size');?><span></span></div><div class="resize filesize-resize"></div>
|
||||
<div class="filetime" field="mtime"><?php echo LNG('modify_time');?><span></span></div><div class="resize filetime-resize"></div>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- list type 列表排序方式 -->
|
||||
|
||||
<div class='bodymain drag-upload-box menu-body-main'>
|
||||
<div class="line-split-box hidden">
|
||||
<div class="split-line"></div>
|
||||
<div class="split-line"></div>
|
||||
<div class="split-line"></div>
|
||||
<div class="split-line"></div>
|
||||
<div class="split-line"></div>
|
||||
<div class="split-line"></div>
|
||||
<div class="split-line"></div>
|
||||
<div class="split-line"></div>
|
||||
<div class="split-line"></div>
|
||||
<div class="split-line"></div>
|
||||
</div>
|
||||
<div class="file-continer"></div>
|
||||
<div class="file-continer-more"></div>
|
||||
</div><!-- html5拖拽上传list -->
|
||||
<div class="file-select-info">
|
||||
<span class="item-num"></span>
|
||||
<span class="item-select"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- / frame-right end-->
|
||||
</div><!-- / frame-main end-->
|
||||
|
@ -0,0 +1,147 @@
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title><?php echo LNG('ui_explorer').' - '.strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
<link href="<?php echo STATIC_PATH;?>style/wap/app_explorer.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="init-loading"><div><img src="<?php echo STATIC_PATH;?>images/common/loading_simple.gif?v=<?php echo KOD_VERSION;?>"/></div></div>
|
||||
<div class="panel-menu">
|
||||
<div class="panel-hd">
|
||||
<span class="my-avator">
|
||||
<?php
|
||||
$avatar = STATIC_PATH.'images/common/pic.jpg';
|
||||
$name = $_SESSION['kodUser']['name'];
|
||||
if($_SESSION['kodUser']['avatar']){
|
||||
$avatar = $_SESSION['kodUser']['avatar'];
|
||||
}
|
||||
if($_SESSION['kodUser']['nickName']){
|
||||
$name = $_SESSION['kodUser']['nickName'];
|
||||
}
|
||||
echo '<img src="'.$avatar.'"/>';
|
||||
?>
|
||||
</span>
|
||||
<div><h3 class="name"><?php echo clear_html($name);?></h3></div>
|
||||
</div>
|
||||
<ul class="left-menu-path"></ul>
|
||||
</div>
|
||||
<div class="frame-main">
|
||||
<div class="panel-mask"></div>
|
||||
<div class="frame-header">
|
||||
<div class="tool tool-menu-left">
|
||||
<div class="menu"><i class="font-icon icon-reorder"></i></div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$config = $GLOBALS['config'];
|
||||
$subMenu = '';
|
||||
foreach ($config['settingSystem']['menu'] as $key=>$value) {
|
||||
if ($value['use']!='1') continue;
|
||||
$has = ST==$value['name']?'this':'';
|
||||
$target = " target='_self'" ;
|
||||
if($value['target']=='1' || $value['target'] == '_blank'){
|
||||
$target = " target='_blank'" ;
|
||||
}
|
||||
$name = $value['name'];
|
||||
if(LNG('ui_'.$name) != 'ui_'.$name){
|
||||
$name = "<i class='font-icon menu-".$value['name']."'></i><span>".LNG('ui_'.$name).'</span>';
|
||||
}
|
||||
if($value['icon']){
|
||||
$name = $value['icon'].'<span>'.LNG($value['name']).'</span>';
|
||||
}
|
||||
$subMenu .= "<li><a class='topbar-menu-sub ".$has."' href='".urldecode($value['url'])."'"
|
||||
.$target.">".urldecode($name)."</a></li>";
|
||||
}
|
||||
?>
|
||||
<?php if($subMenu){?>
|
||||
<div class="menu-group fl tool tool-submenu">
|
||||
<button class="topbar-menu" id="topbar-submenu" data-toggle="dropdown">
|
||||
<i class="icon-home"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu topbar-submenu pull-left animated menuShow" role="menu" aria-labelledby="topbar-submenu">
|
||||
<?php echo $subMenu;?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="title"><?php echo LNG('kod_name');?></div>
|
||||
<div class="menu-group">
|
||||
<div class="btn-list-icon"><i class="font-icon icon-home"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="address">
|
||||
<ul class="yarnball"></ul>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<div class='bodymain'>
|
||||
<div class="file-continer file-list-list"></div>
|
||||
</div>
|
||||
|
||||
<div class="file-menu">
|
||||
<div class="file-action-menu hidden">
|
||||
<div class="action-menu" data-action="action-copy">
|
||||
<span class="content">
|
||||
<i class="font-icon icon-copy"></i><?php echo LNG('copy');?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="action-menu" data-action="action-cute">
|
||||
<span class="content">
|
||||
<i class="font-icon icon-cut"></i><?php echo LNG('cute');?>
|
||||
</span>
|
||||
</div>
|
||||
<div class='action-menu' data-action="action-share">
|
||||
<span class="content">
|
||||
<i class="font-icon icon-share"></i><?php echo LNG('share');?>
|
||||
</span>
|
||||
</div>
|
||||
<div class='action-menu' data-action="action-rname">
|
||||
<span class="content">
|
||||
<i class="font-icon icon-pencil"></i><?php echo LNG('rename');?>
|
||||
</span>
|
||||
</div>
|
||||
<div class='action-menu' data-action="action-download">
|
||||
<span class="content">
|
||||
<i class="font-icon icon-cloud-download"></i><?php echo LNG('download');?>
|
||||
</span>
|
||||
</div>
|
||||
<div class='action-menu' data-action="action-info">
|
||||
<span class="content">
|
||||
<i class="font-icon icon-info"></i><?php echo LNG('info');?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="action-menu" data-action="action-remove">
|
||||
<span class="content">
|
||||
<i class="font-icon icon-trash"></i><?php echo LNG('remove');?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="menu-close">
|
||||
<span class="content">
|
||||
<i class="font-icon icon-ellipsis-horizontal"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include(TEMPLATE.'common/footer.html');?>
|
||||
</div><!-- / frame-main end-->
|
||||
|
||||
<div class="toolbar-menu">
|
||||
<button class="menu-plus tool tool-menu-right-btn" data-toggle="dropdown"></button>
|
||||
<ul class="dropdown-menu tool-menu-right pull-right animated menuShow" role="menu" >
|
||||
<li data-action="upload"><a href="javascript:void();">
|
||||
<i class="font-icon icon-cloud-upload"></i><?php echo LNG('upload');?></a></li>
|
||||
<li data-action="newfolder"><a href="javascript:void();">
|
||||
<i class="font-icon icon-folder-close-alt"></i><?php echo LNG('newfolder');?></a></li>
|
||||
<li data-action="newfile"><a href="javascript:void();">
|
||||
<i class="font-icon icon-file-text"></i><?php echo LNG('newfile');?></a></li>
|
||||
<li data-action="past"><a href="javascript:void();">
|
||||
<i class="font-icon icon-paste"></i><?php echo LNG('past');?></a></li>
|
||||
<li data-action="search"><a href="javascript:void();">
|
||||
<i class="font-icon icon-search"></i><?php echo LNG('search');?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<script type="text/javascript" >
|
||||
G.thisPath = "<?php echo clear_html($dir);?>";
|
||||
seajs.use("<?php echo STATIC_JS;?>/src/explorerWap/main");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,47 @@
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title><?php echo LNG('ui_explorer').' - '.strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/base/app_explorer.css?ver=<?php echo KOD_VERSION;?>"/>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/<?php echo $config['user']['theme'];?>.css?ver=<?php echo KOD_VERSION;?>" id='link-theme-style'/>
|
||||
|
||||
</head>
|
||||
|
||||
<style>
|
||||
<?php if(isset($_GET['type'])){?>
|
||||
.topbar,.common-footer,.bottom-box{display:none;}
|
||||
.frame-header{top:0;}
|
||||
.frame-main{top:0px;bottom:0px;}
|
||||
.frame-main .frame-left #folder-list-tree{bottom:0px !important;}
|
||||
<?php if($_GET['type']=="explorer"){?>
|
||||
.frame-header .header-content .header-left{display:none;}
|
||||
.frame-header .header-content .header-middle{left:12px;}
|
||||
.frame-main .frame-left,.frame-main .frame-resize{display:none;}
|
||||
.frame-main .frame-right{left:0px;}
|
||||
.task-tab{display:none;}
|
||||
<?php } ?>
|
||||
|
||||
<?php if($_GET['type']=="fileList"){?>
|
||||
.frame-header{display:none;}
|
||||
.frame-main .frame-left,.frame-main .frame-resize{display:none;}
|
||||
.frame-main .frame-right{left:0px;}
|
||||
.frame-main{top:0px;}
|
||||
.task-tab,#set_theme,#fav,#home{display:none !important;}
|
||||
.header-middle{top:3px;left:5px;right:140px;}
|
||||
#list-type-header{top:35px;}
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</style>
|
||||
|
||||
|
||||
<body style="overflow:hidden;" oncontextmenu="return core.contextmenu();" id="page-explorer">
|
||||
<?php include(TEMPLATE.'common/navbar.html');?>
|
||||
<?php include(TEMPLATE.'explorer/content.html');?>
|
||||
<?php include(TEMPLATE.'common/footer.html');?>
|
||||
<script type="text/javascript">
|
||||
G.thisPath = "<?php echo clear_html($dir);?>";
|
||||
seajs.use("app/src/explorer/main");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -0,0 +1,45 @@
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title><?php echo LNG('PluginCenter').' - '.strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/base/app_setting.css?ver=<?php echo KOD_VERSION;?>"/>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/<?php echo $config['user']['theme'];?>.css?ver=<?php echo KOD_VERSION;?>" id='link-theme-style'/>
|
||||
|
||||
</head>
|
||||
<body oncontextmenu="return core.contextmenu();">
|
||||
<div id="body" class="plugin-page">
|
||||
<div class="app-menu-left menu-left">
|
||||
<div class="search">
|
||||
<div class="search-btn btn-search font-icon icon-search"></div>
|
||||
<div class="search-btn btn-close font-icon icon-remove hidden"></div>
|
||||
<input type="text" placeholder="<?php echo LNG('search');?>" />
|
||||
</div>
|
||||
<ul class='setting'>
|
||||
<a data-type="install"><i class="font-icon icon-download-alt"></i><?php echo LNG('PluginInstalled');?></a>
|
||||
<a data-type="update"><i class="font-icon icon-refresh"></i><?php echo LNG('PluginUpdate');?></a>
|
||||
</ul>
|
||||
|
||||
<div class="line"><?php echo LNG("PluginType");?></div>
|
||||
<ul class='setting'>
|
||||
<a data-type="all"><i class="font-icon icon-reorder"></i><?php echo LNG("PluginTypeAll");?></a>
|
||||
<a data-type="file"><i class="font-icon icon-folder-open-alt"></i><?php echo LNG("PluginTypeFile");?></la>
|
||||
<a data-type="safe"><i class="font-icon icon-book"></i><?php echo LNG("PluginTypeSafe");?></a>
|
||||
<a data-type="tools"><i class="font-icon icon-suitcase"></i><?php echo LNG("PluginTypeTools");?></a>
|
||||
<a data-type="media"><i class="font-icon icon-film"></i><?php echo LNG("PluginTypeMedia");?></a>
|
||||
<a data-type="others"><i class="font-icon icon-ellipsis-horizontal"></i><?php echo LNG("PluginTypeOthers");?></a>
|
||||
</ul>
|
||||
</div>
|
||||
<div class='app-content main app-plugins'>
|
||||
<div class="app-model app-content-box">
|
||||
<div class='h1'></div>
|
||||
<ul class="app-list"></ul>
|
||||
</div>
|
||||
<div class="app-model app-descript can-select can-right-menu hidden"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include(TEMPLATE.'common/footerCommon.html');?>
|
||||
<script type="text/javascript">
|
||||
seajs.use('app/src/plugins/main');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,32 @@
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title><?php echo strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/base/app_setting.css?ver=<?php echo KOD_VERSION;?>"/>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/<?php echo $config['user']['theme'];?>.css?ver=<?php echo KOD_VERSION;?>" id='link-theme-style'/>
|
||||
|
||||
</head>
|
||||
<body class="setting-page" oncontextmenu="return core.contextmenu();">
|
||||
<div class="init-loading">
|
||||
<div><img src="<?php echo STATIC_PATH;?>images/common/loading_simple.gif?v=<?php echo KOD_VERSION;?>"/></div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div class="menu-left">
|
||||
<h1><?php echo LNG('setting_title');?></h1>
|
||||
<ul class='setting'>
|
||||
<a href="javascript:void(0);" id="system"><i class="font-icon icon-cog"></i><?php echo LNG('system_setting');?></a>
|
||||
<a href="javascript:void(0);" id="member"><i class="font-icon icon-group"></i><?php echo LNG('system_group');?></a>
|
||||
<a href="javascript:void(0);" id="user"><i class="font-icon icon-user"></i><?php echo LNG('setting_user');?></li>
|
||||
<a href="javascript:void(0);" id="theme"><i class="font-icon icon-dashboard"></i><?php echo LNG('setting_theme');?></a>
|
||||
<a href="javascript:void(0);" id="wall"><i class="font-icon icon-picture"></i><?php echo LNG('setting_wall');?></a>
|
||||
<a href="javascript:void(0);" id="fav"><i class="font-icon icon-star"></i><?php echo LNG('setting_fav');?></a>
|
||||
<a href="javascript:void(0);" id="help"><i class="font-icon icon-question"></i><?php echo LNG('setting_help');?></a>
|
||||
<a href="javascript:void(0);" id="about"><i class="font-icon icon-info-sign"></i><?php echo LNG('setting_about');?></a>
|
||||
</ul>
|
||||
</div>
|
||||
<div class='main'></div>
|
||||
</div>
|
||||
<?php include(TEMPLATE.'common/footerCommon.html');?>
|
||||
<script type="text/javascript">
|
||||
seajs.use('app/src/setting/main');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,87 @@
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title><?php echo clear_html($shareInfo['name']).' - '.LNG('share_title').' - '.strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/base/app_code_edit.css?ver=<?php echo KOD_VERSION;?>"/>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/<?php echo $configTheme;?>.css?ver=<?php echo KOD_VERSION;?>" id='link-theme-style'/>
|
||||
|
||||
</head>
|
||||
<body <?php echo $codeThemeBlack;?>>
|
||||
<div class="edit-main" style="height: 100%;" oncontextmenu="return core.contextmenu();">
|
||||
<div class="tools">
|
||||
<div class="left top-toolbar">
|
||||
<div class="disable-mask"></div>
|
||||
<a action="save" href="javascript:;" title="<?php echo LNG('button_save');?>(Ctrl-S)"><i class="font-icon icon-save"></i></a>
|
||||
<a action="saveall" href="javascript:;" title="<?php echo LNG('button_save_all');?>"><i class="font-icon icon-paste"></i></a>
|
||||
<span class="line"></span>
|
||||
<a action="undo" href="javascript:;" title="<?php echo LNG('undo');?>(Ctrl-Z)"><i class="font-icon icon-undo"></i></a>
|
||||
<a action="redo" href="javascript:;" title="<?php echo LNG('redo');?>(Ctrl-Y)"><i class="font-icon icon-repeat"></i></a>
|
||||
<a action="refresh" href="javascript:;" title="<?php echo LNG('refresh');?>(F5)"><i class="font-icon icon-refresh"></i></a>
|
||||
<span class="line"></span>
|
||||
<a href="javascript:;" class="toolbar-menu menu-view-goto-line" title="<?php echo LNG('gotoline');?>(Ctrl-L)"><i class="font-icon icon-pushpin"></i></a>
|
||||
<a action="search" href="javascript:;" title="<?php echo LNG('search');?>(Ctrl-F)"><i class="font-icon icon-search"></i></a>
|
||||
<a action="searchReplace" href="javascript:;" title="<?php echo LNG('replace');?>(Ctrl-F-F)"><i class="font-icon icon-random"></i></a>
|
||||
<span class="line"></span>
|
||||
<a action="font" class="toolbar-menu menu-view-font" href="javascript:;" title="<?php echo LNG('font_size');?>">
|
||||
<i class="font-icon icon-font"></i><i class="font-icon icon-caret-down"></i>
|
||||
</a>
|
||||
<span class="line"></span>
|
||||
<a class="toolbar-menu menu-view-theme" href="javascript:;" title="<?php echo LNG('code_theme');?>">
|
||||
<i class="font-icon icon-magic"></i><i class="font-icon icon-caret-down"></i>
|
||||
</a>
|
||||
<a class="toolbar-menu menu-view-setting" href="javascript:;" title="<?php echo LNG('setting');?>">
|
||||
<i class="font-icon icon-cog"></i><i class="font-icon icon-caret-down"></i>
|
||||
</a>
|
||||
<a action="preview" href="javascript:;" title="<?php echo LNG('preview');?>(Ctrl-Shift-S)"><i class="font-icon icon-eye-open"></i></a>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a action="fullscreen" href="javascript:;" title="<?php echo LNG('full_screen');?>"><i class="font-icon icon-resize-full"></i></a>
|
||||
<a action="close" href="javascript:;" title="<?php echo LNG('close');?>"><i class="font-icon icon-remove"></i></a>
|
||||
</div>
|
||||
<div style="clear:both"></div>
|
||||
</div><!-- end tools -->
|
||||
|
||||
<!-- 主体部分 -->
|
||||
<div class="frame-left">
|
||||
<div class="edit-tab">
|
||||
<div class="tabs">
|
||||
<a href="javascript:Editor.add()" class="add icon-plus"></a>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="edit-body">
|
||||
<div class="introduction hidden">
|
||||
<?php include(LANGUAGE_PATH.I18n::getType().'/edit.html');?>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
<div class="tabs"></div>
|
||||
<div class="bottom-toolbar hidden">
|
||||
<a class="toolbar-menu menu-view-goto-line editor_position" href="javascript:;">0:0</a>
|
||||
<a class="file-mode" href="javascript:;">text</a>
|
||||
<a class="toolbar-menu menuViewTab config-tab" href="javascript:;">Tabs:4</a>
|
||||
<a class="toolbar-menu menu-view-setting config" href="javascript:;"><i class="font-icon icon-cog"></i></a>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-content hidden"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include(TEMPLATE.'common/footerCommon.html');?>
|
||||
<script type="text/javascript">
|
||||
AUTH = {'explorer.fileDownload':<?php echo $canDownload;?>};
|
||||
G.fristFile = "<?php echo (isset($_GET['filename']) ? clear_html($_GET['filename']) :'') ;?>";
|
||||
G.codeConfig = <?php echo $editorConfig;?>;
|
||||
G.codeThemeAll = "<?php echo $config['settingAll']['codethemeall']?>";
|
||||
G.codeFontAll = "<?php echo $config['settingAll']['codefontall']?>";
|
||||
G.user = "<?php echo clear_html($_GET['user']);?>";
|
||||
G.sid = "<?php echo clear_html($_GET['sid']);?>";
|
||||
G.theme = "<?php echo $configTheme;?>";
|
||||
seajs.config({
|
||||
preload: [
|
||||
"lib/jquery-1.8.0.min",
|
||||
'lib/ace/src-min-noconflict/ace'
|
||||
]
|
||||
});
|
||||
seajs.use("app/src/edit/main");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,58 @@
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title><?php echo clear_html($shareInfo['name']).' - '.LNG('share_title').' - '.strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/base/app_editor.css?ver=<?php echo KOD_VERSION;?>"/>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/<?php echo $configTheme;?>.css?ver=<?php echo KOD_VERSION;?>" id='link-theme-style'/>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
<?php if(isset($_GET['project'])){?>
|
||||
<style>
|
||||
.topbar{display: none;}
|
||||
.frame-header,.frame-main,.frame-main .frame-left{top:0;}
|
||||
.edit-content.markdown-full-page .edit-right-frame .markdown-preview {padding-top: 50px;}
|
||||
.edit-body {bottom: 30px;}
|
||||
</style>
|
||||
<?php } ?>
|
||||
|
||||
<?php if(isset($_GET['user'])){?>
|
||||
<style>
|
||||
.frame-main .frame-left{top:0;}
|
||||
.frame-main{bottom:0px;}
|
||||
</style>
|
||||
<?php } ?>
|
||||
|
||||
<body style="overflow:hidden;" oncontextmenu="return core.contextmenu();" id="page-editor">
|
||||
<?php include(TEMPLATE.'common/navbarShare.html');?>
|
||||
<div class="frame-main">
|
||||
<div class='frame-left'>
|
||||
<ul id="folder-list-tree" style="margin-top:10px;" class="ztree"></ul>
|
||||
</div><!-- / frame-left end-->
|
||||
<div class='frame-resize'></div>
|
||||
<div class='frame-right'>
|
||||
<div class="frame-right-main" style="height:100%;padding:0;margin:0;">
|
||||
<div class="resize-mask"></div>
|
||||
<div class="message-box"><div class="content"></div></div>
|
||||
<div class="menu-tree-root"></div>
|
||||
<div class="menu-tree-folder"></div>
|
||||
<div class="menu-tree-file"></div>
|
||||
<div class ='frame'>
|
||||
<iframe name="OpenopenEditor"
|
||||
src="./index.php?share/edit&user=<?php echo clear_html($_GET['user']);?>&sid=<?php echo clear_html($_GET['sid']);?>"
|
||||
style="width:100%;height:100%;border:0;" frameborder=0></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- / frame-right end-->
|
||||
</div><!-- / frame-main end-->
|
||||
<?php include(TEMPLATE.'common/footerCommon.html');?>
|
||||
<script type="text/javascript">
|
||||
AUTH = {'explorer.fileDownload':<?php echo $canDownload;?>};
|
||||
G.project = "<?php echo (isset($_GET['project'])?clear_html($_GET['project']):'') ;?>";
|
||||
G.user = "<?php echo clear_html($_GET['user']);?>";
|
||||
G.sid = "<?php echo clear_html($_GET['sid']);?>";
|
||||
G.shareInfo = <?php echo json_encode($shareInfo);?>;
|
||||
G.theme = "<?php echo $configTheme;?>";
|
||||
seajs.use("app/src/shareEditor/main");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,54 @@
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title><?php echo clear_html($shareInfo['name']).' - '.LNG('share_title').' - '.strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/base/app_explorer.css?ver=<?php echo KOD_VERSION;?>"/>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/<?php echo $configTheme;?>.css?ver=<?php echo KOD_VERSION;?>" id='link-theme-style'/>
|
||||
|
||||
</head>
|
||||
|
||||
<style>
|
||||
.frame-main .frame-left {bottom: 0px;}
|
||||
.frame-main .bottom-box{display:none !important;}
|
||||
.tools-right #set_theme{display:none !important;}
|
||||
#PV_rotate_Left,#PV_rotate_Right,#PV_Btn_Remove{display:none !important;}
|
||||
<?php if(isset($_GET['type'])){?>
|
||||
.topbar,.common-footer,.bottom-box{display:none;}
|
||||
.frame-header{top:0;}
|
||||
.frame-main{top:0px;bottom:0px;}
|
||||
.frame-main .frame-left #folder-list-tree{bottom:5px;}
|
||||
<?php if($_GET['type']=="explorer"){?>
|
||||
.frame-header .header-content .header-left{display:none;}
|
||||
.frame-header .header-content .header-middle{left:12px;}
|
||||
.frame-main .frame-left,.frame-main .frame-resize{display:none;}
|
||||
.frame-main .frame-right{left:0px;}
|
||||
.task-tab{display:none;}
|
||||
<?php } ?>
|
||||
|
||||
<?php if($_GET['type']=="fileList"){?>
|
||||
.frame-header{display:none;}
|
||||
.frame-main .frame-left,.frame-main .frame-resize{display:none;}
|
||||
.frame-main .frame-right{left:0px;}
|
||||
.frame-main{top:0px;}
|
||||
.task-tab,#set_theme,#fav,#home{display:none !important;}
|
||||
.header-middle{top:3px;left:5px;right:140px;}
|
||||
#list-type-header{top:35px;}
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</style>
|
||||
|
||||
|
||||
<body style="overflow:hidden;" oncontextmenu="return core.contextmenu();" id="page-explorer">
|
||||
<?php include(TEMPLATE.'common/navbarShare.html');?>
|
||||
<?php include(TEMPLATE.'explorer/content.html');?>
|
||||
<?php include(TEMPLATE.'common/footer.html');?>
|
||||
<script type="text/javascript" >
|
||||
AUTH = {'explorer.fileDownload':<?php echo clear_html($canDownload);?>};
|
||||
G.thisPath = "<?php echo clear_html($dir);?>";
|
||||
G.user = "<?php echo clear_html($_GET['user']);?>";
|
||||
G.sid = "<?php echo clear_html($_GET['sid']);?>";
|
||||
G.shareInfo = <?php echo json_encode($shareInfo);?>;
|
||||
G.theme = "<?php echo $configTheme;?>";
|
||||
seajs.use("app/src/shareExplorer/main");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,59 @@
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title><?php echo LNG('ui_explorer').' - '.strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
<link href="<?php echo STATIC_PATH;?>style/wap/app_explorer.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="frame-main">
|
||||
<div class="frame-header">
|
||||
<div class="title"><?php echo clear_html($shareInfo['name']);?></div>
|
||||
<div class="menu-group">
|
||||
<div class="btn-list-icon"><i class="font-icon icon-home"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="address">
|
||||
<ul class="yarnball"></ul>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
<div class='bodymain'>
|
||||
<div class="file-continer file-list-list"></div>
|
||||
</div>
|
||||
|
||||
<div class="file-menu">
|
||||
<div class="file-action-menu hidden">
|
||||
<div class='action-menu' data-action="action-download"><i class="font-icon icon-info"></i><?php echo LNG('download');?></div>
|
||||
<div class='action-menu' data-action="action-share-open">
|
||||
<span class="content">
|
||||
<i class="font-icon icon-share"></i><?php echo LNG('open');?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="menu-close"><i class="font-icon icon-ellipsis-horizontal"></i></div>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include(TEMPLATE.'common/footer.html');?>
|
||||
</div><!-- / frame-main end-->
|
||||
<div class="toolbar-menu">
|
||||
<button class="menu-plus tool tool-menu-right-btn" data-toggle="dropdown"></button>
|
||||
<ul class="dropdown-menu tool-menu-right pull-right animated menuShow" role="menu" >
|
||||
<li data-action="upload"><a href="javascript:void();">
|
||||
<i class="font-icon icon-cloud-upload"></i><?php echo LNG('upload');?></a></li>
|
||||
<li data-action="newfolder"><a href="javascript:void();">
|
||||
<i class="font-icon icon-folder-close-alt"></i><?php echo LNG('newfolder');?></a></li>
|
||||
<li data-action="newfile"><a href="javascript:void();">
|
||||
<i class="font-icon icon-file-text"></i><?php echo LNG('newfile');?></a></li>
|
||||
<li data-action="past"><a href="javascript:void();">
|
||||
<i class="font-icon icon-paste"></i><?php echo LNG('past');?></a></li>
|
||||
<li data-action="search"><a href="javascript:void();">
|
||||
<i class="font-icon icon-search"></i><?php echo LNG('search');?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
G.thisPath = "<?php echo clear_html($dir);?>";
|
||||
G.user = "<?php echo clear_html($_GET['user']);?>";
|
||||
G.sid = "<?php echo clear_html($_GET['sid']);?>";
|
||||
G.shareInfo = <?php echo json_encode($shareInfo);?>;
|
||||
seajs.use("<?php echo STATIC_JS;?>/src/explorerWap/main");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,45 @@
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title><?php echo clear_html($shareInfo['name']).' - '.LNG('share_title').' - '.strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/base/app_code_edit.css?ver=<?php echo KOD_VERSION;?>"/>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/<?php echo $configTheme;?>.css?ver=<?php echo KOD_VERSION;?>" id='link-theme-style'/>
|
||||
|
||||
</head>
|
||||
<style type="text/css">
|
||||
.frame-main{bottom: 32px;}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<?php include(TEMPLATE.'common/navbarShare.html');?>
|
||||
<div class="frame-main share-page-main">
|
||||
<!-- bindary-box -->
|
||||
<div class="bindary-box hidden">
|
||||
<div class="title"><div class="ico"></div></div>
|
||||
<div class="content-info">
|
||||
<div class="name"></div>
|
||||
<div class="size"><span></span><i class="share-time"></i></div>
|
||||
<div class="btn-group">
|
||||
<a type="button" class="btn btn-primary btn-download" href=""><?php echo LNG('download');?></a>
|
||||
</div>
|
||||
<div class="error-tips"><?php echo LNG('share_error_show_tips');?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-box"></div>
|
||||
</div><!-- / frame-main end-->
|
||||
<?php include(TEMPLATE.'common/footer.html');?>
|
||||
<script type="text/javascript">
|
||||
AUTH = {'explorer.fileDownload':<?php echo $canDownload;?>};
|
||||
G.user = "<?php echo clear_html($_GET['user']);?>";
|
||||
G.path = "<?php echo clear_html($_GET['path']);?>";
|
||||
G.sid = "<?php echo clear_html($_GET['sid']);?>";
|
||||
G.shareInfo = <?php echo json_encode($shareInfo);?>;
|
||||
G.theme = "<?php echo $configTheme;?>";
|
||||
seajs.config({
|
||||
preload: [
|
||||
"lib/jquery-1.8.0.min",
|
||||
'lib/ace/src-min-noconflict/ace'
|
||||
]
|
||||
});
|
||||
seajs.use("app/src/shareIndex/main");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,26 @@
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title>tips - <?php echo LNG('share_title').' - '.strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/base/app_code_edit.css?ver=<?php echo KOD_VERSION;?>"/>
|
||||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/<?php echo $configTheme;?>.css?ver=<?php echo KOD_VERSION;?>" id='link-theme-style'/>
|
||||
|
||||
</head>
|
||||
|
||||
<body style="overflow:hidden;">
|
||||
<?php include(TEMPLATE.'common/navbarShare.html');?>
|
||||
<div class="frame-main">
|
||||
<?php if($msg=='password'){?>
|
||||
<div class="share-page-passowrd">
|
||||
<div class="title"><?php echo LNG('share_password');?></div>
|
||||
<input type="password" class="form-control"/>
|
||||
<a href="javascript:void(0);" class="btn btn-primary share-login"><?php echo LNG('button_ok');?></a>
|
||||
</div>
|
||||
<?php }else{?>
|
||||
<div class="share-page-error"><b>tips:</b><?php echo $msg;?></div>
|
||||
<?php }?>
|
||||
</div><!-- / frame-main end-->
|
||||
<?php include(TEMPLATE.'common/footer.html');?>
|
||||
<script type="text/javascript">
|
||||
seajs.use("app/src/shareIndex/main");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,63 @@
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<link href="<?php echo STATIC_PATH;?>style/login.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet">
|
||||
<title><?php echo LNG('php_env_check').' - '.strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php echo pageBackground();?>
|
||||
<div class="background"></div>
|
||||
<div class="loginbox box-install aero" >
|
||||
<div class="title">
|
||||
<div class="logo"><i class="icon-cloud"></i><?php echo strip_tags(LNG('kod_name'));?></div>
|
||||
<div class='info'><?php echo LNG('kod_name_desc');?></div>
|
||||
<div class="menu-group">
|
||||
<a id='footer-language' data-toggle="dropdown" href="javascript:void(0);" class="topbar-menu">
|
||||
<i class='font-icon icon-flag'></i>Language<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu footer-language pull-left animated menuShow" role="menu" aria-labelledby="footer-language">
|
||||
<?php
|
||||
$tpl = "";
|
||||
foreach ($config['settingAll']['language'] as $key => $value) {
|
||||
$name = $value[0];
|
||||
$select = I18n::getType() == $key ? "this":"";
|
||||
$tpl .= "<li><a href='javascript:core.language(\"{$key}\");' title=\"{$key}/{$value[1]}/{$value[2]}\" class='{$select}'><i class='lang-flag flag-{$key}'></i>{$name}</a></li>";
|
||||
}
|
||||
echo $tpl;
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form" style="padding: 10px 20px 40px 20px;">
|
||||
<h3><?php echo LNG('php_env_check');?></h3>
|
||||
<?php
|
||||
$error = php_env_check();
|
||||
$login = LNG('login');
|
||||
if ($error=='') {
|
||||
echo '<div class="success">';
|
||||
}else{
|
||||
echo '<div class="error"><h4>error:</h4>'.$error."<br/>";
|
||||
$login = LNG('php_env_error_ignore');
|
||||
}
|
||||
$login_info = str_replace(array("{0}","{1}","{2}"),array('admin','demo/demo','guest/guest'),LNG('install_user_default'));
|
||||
echo LNG('install_login'),'<br/>'.$login_info.'</div>';
|
||||
echo '<div class="inputs admin-password"><input type="password" placeholder="'.LNG('login_root_password').'"/></div><div class="inputs admin-password-repeat"><input type="password" placeholder="'.LNG('login_root_password_repeat').'"/></div>';
|
||||
echo '<div class="guest"><a href="javascript:void(0);" class="start">'.$login.'</a></div>';
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $GLOBALS['loadCommonJs'] = true;?>
|
||||
<?php include(TEMPLATE.'common/footer.html');?>
|
||||
<script type="text/javascript" >
|
||||
setTimeout(function(){
|
||||
if( typeof(seajs) == 'undefined' ||
|
||||
typeof(LNG) == 'undefined'
|
||||
){
|
||||
alert('js文件不完整,请查看浏览器控制台和服务器配置是否正常。或检查文件是否被修改(或咨询主机商压缩js导致文件损坏);[js load error!]');
|
||||
}
|
||||
},1000);
|
||||
seajs.use("<?php echo STATIC_JS;?>/src/user/main");
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,30 @@
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title><?php echo 'License Register - '.strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
<link href="<?php echo STATIC_PATH;?>style/login.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body class="license-page">
|
||||
<?php echo pageBackground();?>
|
||||
<div class="background"></div>
|
||||
<div class="loginbox aero" >
|
||||
<div class="title">
|
||||
<div class="logo">升级为商业版</div>
|
||||
<div class='info'><?php echo LNG('copyright_contact');?></div>
|
||||
</div>
|
||||
<div class="form" style="padding: 10px 20px;">
|
||||
<div class="inputs admin-password"><input type="text" placeholder="LICENSE KEY"/></div>
|
||||
<a href="javascript:void(0);" class="LICENSE_SUBMIT btn btn-primary">注册授权</a>
|
||||
<div class="links">
|
||||
<a href="./index.php?user/versionInstall&reset=1" class="btn btn-link license-use-free"><?php echo LNG('use_free');?></a>
|
||||
<a href="http://kodcloud.com/buy.html#<?php echo I18n::getType();?>" target="_blank" class="btn btn-link license-learn-more"><?php echo LNG('learn_more');?></a>
|
||||
</div>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
<?php $GLOBALS['loadCommonJs'] = true;?>
|
||||
<?php include(TEMPLATE.'common/footer.html');?>
|
||||
<script type="text/javascript" >
|
||||
seajs.use("<?php echo STATIC_JS;?>/src/user/main");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,91 @@
|
||||
<!--user login-->
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title><?php echo strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
<link href="<?php echo STATIC_PATH;?>style/login.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php echo pageBackground();?>
|
||||
<div class="background"></div>
|
||||
<div class="init-loading"><div><img src="<?php echo STATIC_PATH;?>images/common/loading_simple.gif?v=<?php echo KOD_VERSION;?>"/></div></div>
|
||||
<div class="loginbox animated-500 fadeInDown aero" >
|
||||
<div class="title">
|
||||
<div class="logo"><i class="icon-cloud"></i><?php echo strip_tags(LNG('kod_name'));?></div>
|
||||
<div class='info'><?php echo LNG('kod_name_desc');?></div>
|
||||
<?php if(!isset($config['settings']['language'])){ ?>
|
||||
<div class="menu-group">
|
||||
<a id='footer-language' data-toggle="dropdown" href="javascript:void(0);" class="topbar-menu">
|
||||
<i class='font-icon icon-flag'></i>Language<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu footer-language pull-left animated menuShow" role="menu" aria-labelledby="footer-language">
|
||||
<?php
|
||||
$tpl = "";
|
||||
foreach ($config['settingAll']['language'] as $key => $value) {
|
||||
$name = $value[0];
|
||||
$select = I18n::getType() == $key ? "this":"";
|
||||
$tpl .= "<li><a href='javascript:core.language(\"{$key}\");' title=\"{$key}/{$value[1]}/{$value[2]}\" class='{$select}'><i class='lang-flag flag-{$key}'></i>{$name}</a></li>";
|
||||
}
|
||||
echo $tpl;
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="form">
|
||||
<form action="#">
|
||||
<div class="inputs">
|
||||
<div>
|
||||
<i class="font-icon icon-user"></i>
|
||||
<input id="username" name='name' type="text" placeholder="<?php echo LNG('username');?>"
|
||||
required autocomplete="on" disabled/>
|
||||
</div>
|
||||
<div>
|
||||
<i class="font-icon icon-key"></i>
|
||||
<input id="password" name='password' type="password" placeholder="<?php echo LNG('password');?>"
|
||||
required autocomplete="on" disabled/>
|
||||
<input type='hidden' name='csrfLogin' value="<?php echo $_SESSION['csrfLogin'];?>"/>
|
||||
</div>
|
||||
<?php if(need_check_code()){?>
|
||||
<div class='check-code'>
|
||||
<i class="font-icon icon-unlock-alt"></i>
|
||||
<input name='checkCode' class="check-code" type="text" placeholder="<?php echo LNG('login_code');?>" required/>
|
||||
<img src='./index.php?user/checkCode' onclick="this.src='./index.php?user/checkCode'" />
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<label for='rm'>
|
||||
<input type="checkbox" class="checkbox" name="rememberPassword" id='rm'/>
|
||||
<?php echo LNG('login_rember_password');?>
|
||||
</label>
|
||||
<a href="javascript:void(0);" class="forget-password"><?php echo LNG('forget_password');?></a>
|
||||
<br/>
|
||||
<input type="submit" id="submit" value="<?php echo LNG('login');?>" />
|
||||
</div>
|
||||
|
||||
<div class="msg"><?php echo $msg;?></div>
|
||||
|
||||
<?php if ($this->config['settingSystem']['autoLogin'] == '1') {?>
|
||||
<div class='guest'>
|
||||
<a href="./index.php?user/loginSubmit&name=guest&password=guest"><?php echo LNG('guest_login');?><i class=' icon-arrow-right'></i></a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $GLOBALS['loadCommonJs'] = true;?>
|
||||
<?php include(TEMPLATE.'common/footer.html');?>
|
||||
<script type="text/javascript" >
|
||||
setTimeout(function(){
|
||||
if( typeof(seajs) == 'undefined' ||
|
||||
typeof(LNG) == 'undefined'
|
||||
){
|
||||
alert('js文件不完整,请查看浏览器控制台和服务器配置是否正常。或检查文件是否被修改(或咨询主机商压缩js导致文件损坏);[js load error!]');
|
||||
}
|
||||
},1000);
|
||||
seajs.use("<?php echo STATIC_JS;?>/src/user/main");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,65 @@
|
||||
<!--user login-->
|
||||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<link href="<?php echo STATIC_PATH;?>style/wap/login.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet">
|
||||
<title><?php echo strip_tags(LNG('kod_name')).LNG('kod_power_by');?></title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php echo pageBackground();?>
|
||||
<div class="background"></div>
|
||||
<div class="loginbox login-wap aero" >
|
||||
<div class="title">
|
||||
<div class="logo">
|
||||
<i class="icon-cloud"></i><?php echo strip_tags(LNG('kod_name'));?>
|
||||
</div>
|
||||
<div class='info'><?php echo LNG('kod_name_desc');?></div>
|
||||
</div>
|
||||
<div class="form">
|
||||
<form action="#">
|
||||
<div class="inputs">
|
||||
<div>
|
||||
<i class="font-icon icon-user"></i>
|
||||
<input id="username" name='name' type="text" placeholder="<?php echo LNG('username');?>"
|
||||
required disabled/>
|
||||
</div>
|
||||
<div>
|
||||
<i class="font-icon icon-key"></i>
|
||||
<input id="password" name='password' type="password" placeholder="<?php echo LNG('password');?>"
|
||||
required disabled/>
|
||||
<input type='hidden' name='csrfLogin' value="<?php echo $_SESSION['csrfLogin'];?>"/>
|
||||
</div>
|
||||
|
||||
<?php if(need_check_code()){?>
|
||||
<div class='check-code'>
|
||||
<i class="font-icon icon-unlock-alt"></i>
|
||||
<input name='checkCode' class="check-code" type="text" placeholder="<?php echo LNG('login_code');?>" required/>
|
||||
<img src='./index.php?user/checkCode' onclick="this.src='./index.php?user/checkCode'" />
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<label for='rm'>
|
||||
<input type="checkbox" class="checkbox" name="rememberPassword" id='rm'/>
|
||||
<?php echo LNG('login_rember_password');?>
|
||||
</label>
|
||||
<a href="javascript:void(0);" class="forget-password"><?php echo LNG('forget_password');?></a>
|
||||
<input type="submit" id="submit" value="<?php echo LNG('login');?>" />
|
||||
</div>
|
||||
<div class="msg"><?php echo $msg;?></div>
|
||||
|
||||
<?php if ($this->config['settingSystem']['autoLogin'] == '1') {?>
|
||||
<div class='guest'>
|
||||
<a href="./index.php?user/loginSubmit&name=guest&password=guest"><?php echo LNG('guest_login');?><i class=' icon-arrow-right'></i></a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $GLOBALS['loadCommonJs'] = true;?>
|
||||
<?php include(TEMPLATE.'common/footer.html');?>
|
||||
<script type="text/javascript" >
|
||||
seajs.use("<?php echo STATIC_JS;?>/src/user/main");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,33 @@
|
||||
<div class="box">
|
||||
<div class="title"><span>KODExplorer غير ماذا؟</span></div>
|
||||
<p>KODExplorer هو إدارة الوثائق على الانترنت على شبكة الإنترنت مفتوح المصدر، محرر التعليمات البرمجية. ويوفر نوعا من النوافذ الكلاسيكية واجهة المستخدم، ومجموعة من إدارة الوثائق على الانترنت، ومعاينة ملف، تحرير، تحميل وتنزيل، بفك الانترنت تشغيل الموسيقى. يسمح لك لتحقيق التنمية على شبكة الإنترنت مباشرة في المتصفح، وشفرة المصدر معاينة الملف، ونشر صاحب الموقع والعملية المحلية وسهلة وسريعة وتجربة آمنة.</p>
|
||||
<p><b>- تصميم -</b></p>
|
||||
<p>التقاليد الكلاسيكية، والسعي للابتكار، لتزويد المستخدمين مع مريحة، آمنة وسهلة لاستخدام نظام إدارة سحابة على الانترنت.</p>
|
||||
<p>كلما (متى)، حيث (حيث)، لديه شبكة الإنترنت كلما تريد (تريد) هو أداة لإدارة الخاص بك (4W السياسة).</p>
|
||||
<p><b>- المستخدم المنحى -</b></p>
|
||||
<p>حاليا نظام إدارة KODExplorer تقع أساسا في سحابة استضافة شخصية، صغير إدارة المشاريع سحابة الموارد وإدارة القرص الشبكة، وإدارة المواقع الصغيرة والمتوسطة. مطور ويب و الماجستير (قدامى المحاربين): محرر على الانترنت، والنسخ الاحتياطي مضغوط، نشر، الكلاسيكية تشغيل ويندوز واجهة، من السهل أن تبدأ وتخلص من SSH المضيف، الأمر FTP عمليات الحفر معقدة.</p>
|
||||
<p>سحابة شخصية خاصة (الصاعد): موارد القرص شبكة الإدارية، ونفس العملية النوافذ الكلاسيكية واجهة، يمكنك وضع محرك الأقراص الموسيقى تصفح الشبكة، وملفات الشاشة، تحميل وتنزيل بسرعة وسهولة.</p>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="title"><span>ميزات</span></div>
|
||||
<p>إدارة ثيقة شاملة وقوية محرر الملفات على الإنترنت</p>
|
||||
<p>أينما كنت، يمكنك إدارة الملفات الخاصة بك، والترفيه عبر الإنترنت، على شبكة الإنترنت كتابة رمز! تماما كما مناسبة للاستخدام في نظام التشغيل.</p>
|
||||
<p>واسعة النطاق بحق عملية تجربة زرع المحلي، السحب، مربع التحديد، اختصارات، البحث عن الملفات (المحتوى البحث) ......</p>
|
||||
<p>مربع الاختيار، السحب الحركة، وسحب وإسقاط تحميل، محرر على الانترنت، ومشغل فيديو، ضغط. كامل الأداء ضمان اياكس والخبرة!</p>
|
||||
<p>كل وظيفة الربط السلس المباشر، في شكل حوار، وظائف إدارة متعددة المهام</p>
|
||||
<p>محرر يدعم-متعددة وثيقة، ودعم ZendCoding أتش تي أم أل، المغلق، شبيبة أعلى الترميز الكفاءة!</p>
|
||||
<p>الدعم الصيني الكمال، مشوه حل حالات مختلفة؛</p>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="title"><span>المصدر المفتوح اعتماد التكنولوجيا</span></div>
|
||||
<p><b>1.Jquery:</b>jpuery (المساعد: Hotkeys.ztree.contentmenu) شبيبة إطار التنمية السائد. تشغيل عملية دوم، BOM، عملية المغلق، وحزمة اياكس</p>
|
||||
<p><b>2.ArtDialog:</b>تصميم جميل، والتوافق متصفح قوي القطعة الحوار. لذا المنبثقة مقبض، والأحداث، ونقل البيانات للحصول على إدارة أفضل موحدة</p>
|
||||
<p><b>3.Ztree:</b>شجرة التحكم القائمة، والتدرجية هو جدا قوية شجرة معالجة البيانات القطعة</p>
|
||||
<p><b>4.codemirror:</b>محرر كود شبيبة الإضافات، ويدعم مجموعة متنوعة من لغات البرمجة لتسليط الضوء على</p>
|
||||
<p><b>5.zendcoding:</b>على رموز الدعم أتش تي أم أل الكتابة بسرعة المكونات الإضافية. يبسط يتم كتابة تعريف من التعليمات البرمجية. تجميع بسيط</p>
|
||||
<p><b>6.less:</b>نموذج تنمية المغلق كفاءة وظيفية لتحسين الواجهة الأمامية المغلق إعادة استخدام . تجميع بسيط</p>
|
||||
<p><b>7.SWFUpload:</b>ملف فلاش تحميل</p>
|
||||
<p><b>8 .CMP4:</b>لاعب فلاش جيد جدا المساعد ملفات الوسائط، ودعم تدفق وسائل الاعلام، شعبية أداة تشغيل الموسيقى والفيديو. دعم للبشرة، وإعدادات شكلي للغاية. قائمة ديناميكية أكس تحميل. رسائل الوسائط المتعددة تدفق وسائل الاعلام، RSTP رخصة مفتوحة المصدر دعم تشغيل الوسائط</p>
|
||||
</div>
|
@ -0,0 +1,72 @@
|
||||
<div class="intro-left" style=";text-align:right;direction:rtl">
|
||||
<div class="tips blue" style=";text-align:right;direction:rtl">
|
||||
<h1 style=";text-align:right;direction:rtl"> <span>الوظائف الغنية</span> </h1>
|
||||
<p style=";text-align:right;direction:rtl"> كود يطالب تلقائيا </p>
|
||||
<p style=";text-align:right;direction:rtl"> متعددة موضوع: اختيار أسلوب البرمجة المفضلة لديك </p>
|
||||
<p style=";text-align:right;direction:rtl"> الخط مخصص: للاستخدام في المشهد </p>
|
||||
<p style=";text-align:right;direction:rtl"> تحرير المؤشر متعددة، كتلة التحرير على الانترنت خبرة في البرمجة مماثلة للسامية </p>
|
||||
<p style=";text-align:right;direction:rtl"> كتلة قابلة للطي، التوسع؛ التفاف </p>
|
||||
<p style=";text-align:right;direction:rtl"> دعم العديد من علامات التبويب، اسحب تسلسل التبديل. </p>
|
||||
<p style=";text-align:right;direction:rtl"> الحفاظ على وثائق متعددة، والعثور على واستبدال، التاريخ؛ </p>
|
||||
<p style=";text-align:right;direction:rtl"> الإكمال التلقائي []، {}، ()، '' '' </p>
|
||||
<p style=";text-align:right;direction:rtl"> على الانترنت المعاينة في الوقت الحقيقي الذي يسمح لك أن تقع في الحب مع البرمجة على الانترنت! </p>
|
||||
<p style=";text-align:right;direction:rtl"> zendcodeing الدعم، كتابة التعليمات البرمجية ثمانين </p>
|
||||
<p style=";text-align:right;direction:rtl"> المزيد من الميزات انتظار اكتشاف الخاص بك ...... </p>
|
||||
</div>
|
||||
<div class="tips orange" style=";text-align:right;direction:rtl">
|
||||
<h1 style=";text-align:right;direction:rtl"> <span>150 نوعا من تسليط الضوء على كود</span> </h1>
|
||||
<p style=";text-align:right;direction:rtl"> نصيحة: أتش تي أم أل، وجافا سكريبت، المغلق، أقل، ساس، SCSS </p>
|
||||
<p style=";text-align:right;direction:rtl"> تطوير الشبكة: PHP، بيرل، بيثون، روبي، elang، انتقل ... </p>
|
||||
<p style=";text-align:right;direction:rtl"> اللغات التقليدية: جافا، C و C ++، C #، أكشن، فبسكريبت ... </p>
|
||||
<p style=";text-align:right;direction:rtl"> البعض: تخفيض السعر، قذيفة، مزود، لوا، أكس، YAML ... </p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="intro-right" style=";text-align:right;direction:rtl">
|
||||
<div class="tips green" style=";text-align:right;direction:rtl">
|
||||
<h1 style=";text-align:right;direction:rtl"> <span>عمل اختصار</span> </h1>
|
||||
<pre style=";text-align:right;direction:rtl"> الاختصارات المستخدمة شيوعا:
|
||||
CTRL + S لحفظ
|
||||
+ السيطرة على اختيار كل CTRL + X قص
|
||||
CTRL + C CTRL + V لصق نسخة
|
||||
CTRL + Z التراجع عن التراجع عن مكافحة CTRL + Y
|
||||
CTRL + F للبحث عن استبدال CTRL + و + و
|
||||
فوز + ALT + 0 انهيار كل فوز + Alt + العالي + 0 توسيع جميع
|
||||
ESC [بحث الخروج تلقائيا إلغاء يطالب ...]
|
||||
السيطرة التحول ليالي معاينة
|
||||
السيطرة التحول الإلكتروني تظهر وإغلاق وظيفة
|
||||
</pre>
|
||||
<pre style=";text-align:right;direction:rtl"> اختيار:
|
||||
سرادق الماوس - السحب
|
||||
تحول + الوطن / نهاية / أعلى / يسار / أسفل / الحق
|
||||
تحول + PAGEUP / بين pagedown الوجه صعودا وهبوطا لتحديد
|
||||
السيطرة تحول + + الوطن / نهاية المؤشر الحالي إلى بداية ونهاية
|
||||
ALT + الماوس لسحب اختيار كتلة
|
||||
CTRL + ALT + ز دفعة حدد وأدخل محرر متعدد التبويب الحالي
|
||||
</pre>
|
||||
<pre style=";text-align:right;direction:rtl"> المؤشر:
|
||||
الوطن / نهاية / أعلى / يسار / أسفل / الحق
|
||||
CTRL + الوطن / نهاية تحريك المؤشر إلى الوثيقة رأس / ذيل
|
||||
CTRL + ص الانتقال إلى العلامة مطابقة
|
||||
PAGEUP / بين pagedown المؤشر صعودا وهبوطا
|
||||
ALT + المؤشر الأيسر / الأيمن للانتقال إلى أعلى من خط
|
||||
تحول + المؤشر الأيسر / الأيمن إلى نهاية السطر و
|
||||
السيطرة + لتر إلى القفز إلى صف معين
|
||||
CTRL + ALT + لأعلى / أسفل (أدناه) زيادة المؤشر
|
||||
</pre>
|
||||
<pre style=";text-align:right;direction:rtl"> تحرير:
|
||||
CTRL + / تعليق والسيطرة غير تعليق + ALT + وبرر
|
||||
علامة التبويب جدول محاذاة التحول + طاولة التقدم الشامل
|
||||
حذف حذف حذف السيطرة خط كامل + د
|
||||
السيطرة + حذف لحذف الصف والكلمة الصحيحة
|
||||
السيطرة / التحول + BACKSPACE لحذف كلمة على اليسار
|
||||
SHIFT + ALT + أعلى / أسفل، وأضاف إلى خط النسخ (أدناه) طائرة
|
||||
ALT + DELETE لحذف محتويات يمين المؤشر
|
||||
بديل + أعلى / أسفل على السطر الحالي والخط (تبادل السطر التالي)
|
||||
CTRL + SHIFT + د صفوف نسخ وإضافة إلى ما يلي
|
||||
السيطرة + حذف لحذف يمين الكلمة
|
||||
السيطرة تحول + + يو تحويلها إلى أحرف صغيرة
|
||||
CTRL + ش النص المحدد إلى أحرف كبيرة
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -0,0 +1,36 @@
|
||||
<div class="box" style=";text-align:right;direction:rtl">
|
||||
<div class="title" style=";text-align:right;direction:rtl"> <span>إدارة ملف</span> </div>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-tags"></i> اختيار ملف: راديو، سرادق الماوس، وتحول الانتخابات، السيطرة اختيارهم عشوائيا، لوحة المفاتيح صعودا وهبوطا، المنزل، واختيار نهاية. </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-folder-open"></i> تشغيل ملف: بعد اختيار الملف، يمكنك نسخ، قص، حذف، عرض خصائص ضغط، إعادة تسمية، ومعاينة المفتوحة وغيرها من العمليات ...... </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-cloud-upload"></i> تحميل الملف: تحميل ملفات متعددة دفعة، HTML5 تحميل السحب (سحب للتحميل بسهولة النافذة، سحب وإسقاط الدعم للمجلدات) </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-cogs"></i> وظيفة الصحيحة: بزر الماوس الأيمن ملف أو مجلد، الحق، الحق أكثر بعد العملية الانتخابية، سطح المكتب، والحق، والحق شجرة الدليل، اختصارات القائمة ملزمة اليمين <br/>
|
||||
(حدد الكل - نسخ - قص - لصق - حذف - إعادة تسمية، تعيين ......) </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-sitemap"></i> متصفح ملف: وضع قائمة، وضع رمز، انقر نقرا مزدوجا فوق في مجلدات فرعية، عملية شريط العنوان؛ فتح سجل سجل مجلد مناقضة (إلى الأمام والخلف) </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-move"></i> دعم السحب والإسقاط: تحقق من السحب، وقطع لتحقيق وظيفة المجلد المحدد </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-reply"></i> مفاتيح الاختصار: حذف حذف، CTRL + A تحديد الكل، CTRL + C لنسخ، + X قص، بحث ملف (محتوى البحث) السيطرة </p>
|
||||
</div>
|
||||
<div class="box" style=";text-align:right;direction:rtl">
|
||||
<div class="title" style=";text-align:right;direction:rtl"> <span>معاينة ملف</span> </div>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-edit"></i> معاينة الملف: عرض محتويات ملف تحرير النص والادخار، أتش تي أم أل، معاينة ملف فرنك سويسري، </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-picture"></i> معاينة الصورة: الجيل التلقائي للصور المصغرة، صورة عرض الشرائح. </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-music"></i> تشغيل الصوت: تشغيل الموسيقى على الانترنت وملفات الفيديو؛ دعم MP3، WMA، منتصف، AAC، WAV، MP4، </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-play"></i> فيديو: تشغيل الفيديو عبر الإنترنت، الصيغ المدعومة: FLV، F4V، 3GP </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-play"></i> المكتب: مكتب معاينة الانترنت، الصيغ المدعومة: وثيقة، docx، باور بوينت، PPTX، XLS، XLSX </p>
|
||||
</div>
|
||||
<div class="box" style=";text-align:right;direction:rtl">
|
||||
<div class="title" style=";text-align:right;direction:rtl"> <span>الاختصارات</span> </div>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-tags"></i> إدخال المفتوحة </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-tags"></i> + السيطرة مختارة جميع </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-tags"></i> CTRL + C لنسخ المحدد </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-tags"></i> CTRL + V للصق </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-tags"></i> CTRL + X قص </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-tags"></i> CTRL + F للبحث في الدليل الحالي </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-tags"></i> بديل + ن ملف جديد </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-tags"></i> ALT + م مجلد جديد </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-tags"></i> حذف حذف المحدد </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-tags"></i> مسافة للخلف العودة </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-tags"></i> CTRL + مسافة للخلف إلى الأمام </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-tags"></i> F2 إعادة تسمية مختارة (مجلد) </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-tags"></i> الوطن / نهاية / أعلى / أسفل / يسار / يمين لتحديد الملف </p>
|
||||
<p style=";text-align:right;direction:rtl"><i class="icon-tags"></i> لرد ضغط تحقق للضغط على الحرف الأول من الملفات الشخصية والمجلدات المحددة دورة التلقائي </p>
|
||||
</div>
|